From patchwork Sat Oct 17 07:54:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11842677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5189FC433DF for ; Sat, 17 Oct 2020 07:56:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6A0C2073A for ; Sat, 17 Oct 2020 07:56:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N+yUf/Hw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437525AbgJQH4B (ORCPT ); Sat, 17 Oct 2020 03:56:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437522AbgJQH4A (ORCPT ); Sat, 17 Oct 2020 03:56:00 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C917C061755 for ; Sat, 17 Oct 2020 00:55:59 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id e10so2866838pfj.1 for ; Sat, 17 Oct 2020 00:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s8vVoXiXZzh0fLZS99sdzB1AzmUqV0PIa/JAkir7jYo=; b=N+yUf/HwUA1d6SnMIS/wVyKryQF8JmrrhnjirRypLDpWzVHVUHLiC6WH/LwxsccU1R u0UYBxU2m3lwyhV2fez8jQWGEzjNWwSiUwbZscXI+XqNWPlu1PlEwnNBRTRCtJt7f7sn 11CbZJUofj7WQxFedMow8YDb3C/tHSPMrrwQSk8f0+jo6ojvTn3HFivitVM8ISCFAcFr HNjBJPKvVnZOY1R2/iD8xgT+KktF5ToRcVJ/7Zrq3ZLJEvHl2hpYV6oFJI6l+soRG1Po Rc8gM30Il4t+g8fFWf1sbrVdfrKtH+6x09kmR7wA3+20qqJaKa/Ud51b6vpyej1200Kb pSXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s8vVoXiXZzh0fLZS99sdzB1AzmUqV0PIa/JAkir7jYo=; b=uUNq4M1++9Dn6C+r0oHIWC8Dse/OuVa6m6VTYT4SW2ZeTIkfqFO2WDPv3zR5VE4/IJ kcezcT/kDtOXw0A0ghy2cXvb80AxQnfwo/+sEEx+DFfdHu3Z+vDaPjJiUviSqjDLz2FH l0/VA+39fX9XEv/sCJIHhkUjA7wX6DnatqF60UFbAnxBD/RRzx/m7r7vhuVzrcg+mLcs MJUSE7lmilTh8rGjA3cPQFE5RqS8oDhAJ80L9rMyS0XHDfiYuRznO1stSBxcmZKUAO5Q gdgAKgBF7LM2yMAtD2MUhz/If+iz7nUZapxwHO0y9+FJS8bNWse4Scbl1/9lQ+53ZMkX mLsA== X-Gm-Message-State: AOAM531PP4onimUywaMMROfg5nukAxoHUQhFQq6LTU/Wc6aPx6L8/fSV 2fU/gYc6iS1ndFM+GL1fcV8Vksc7DpRWjGhv X-Google-Smtp-Source: ABdhPJzx7ufIV3lDU66RLIcFrxSne6khGApV8oSChbaD153n7YaB5vlOjWbCk8wc0cxJ9RswGIqMiA== X-Received: by 2002:a65:6719:: with SMTP id u25mr6261637pgf.346.1602921357183; Sat, 17 Oct 2020 00:55:57 -0700 (PDT) Received: from localhost.localdomain ([106.201.2.128]) by smtp.gmail.com with ESMTPSA id t2sm4994162pji.12.2020.10.17.00.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 00:55:56 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v2 1/5][Outreachy] t7101,t7102,t7201: modernize test formatting Date: Sat, 17 Oct 2020 13:24:51 +0530 Message-Id: <20201017075455.9660-2-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201017075455.9660-1-charvi077@gmail.com> References: <20201015175709.20121-1-charvi077@gmail.com> <20201017075455.9660-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Some tests in these scripts are formatted using a very old style: test_expect_success \ 'title' \ 'body line 1 && body line 2' Updating the formatting to the modern style: test_expect_success 'title' ' body line 1 && body line 2 ' Signed-off-by: Charvi Mendiratta --- t/t7101-reset-empty-subdirs.sh | 66 +++++++++++++++++----------------- t/t7102-reset.sh | 24 +++++-------- t/t7201-co.sh | 31 ++++++++-------- 3 files changed, 56 insertions(+), 65 deletions(-) diff --git a/t/t7101-reset-empty-subdirs.sh b/t/t7101-reset-empty-subdirs.sh index 96e163f084..bfce05ac5d 100755 --- a/t/t7101-reset-empty-subdirs.sh +++ b/t/t7101-reset-empty-subdirs.sh @@ -6,16 +6,15 @@ test_description='git reset should cull empty subdirs' . ./test-lib.sh -test_expect_success \ - 'creating initial files' \ - 'mkdir path0 && +test_expect_success 'creating initial files' ' + mkdir path0 && cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && git add path0/COPYING && - git commit -m add -a' + git commit -m add -a +' -test_expect_success \ - 'creating second files' \ - 'mkdir path1 && +test_expect_success 'creating second files' ' + mkdir path1 && mkdir path1/path2 && cp "$TEST_DIRECTORY"/../COPYING path1/path2/COPYING && cp "$TEST_DIRECTORY"/../COPYING path1/COPYING && @@ -25,39 +24,40 @@ test_expect_success \ git add path1/COPYING && git add COPYING && git add path0/COPYING-TOO && - git commit -m change -a' + git commit -m change -a +' -test_expect_success \ - 'resetting tree HEAD^' \ - 'git reset --hard HEAD^' +test_expect_success 'resetting tree HEAD^' ' + git reset --hard HEAD^ +' -test_expect_success \ - 'checking initial files exist after rewind' \ - 'test -d path0 && - test -f path0/COPYING' +test_expect_success 'checking initial files exist after rewind' ' + test -d path0 && + test -f path0/COPYING +' -test_expect_success \ - 'checking lack of path1/path2/COPYING' \ - '! test -f path1/path2/COPYING' +test_expect_success 'checking lack of path1/path2/COPYING' ' + ! test -f path1/path2/COPYING +' -test_expect_success \ - 'checking lack of path1/COPYING' \ - '! test -f path1/COPYING' +test_expect_success 'checking lack of path1/COPYING' ' + ! test -f path1/COPYING +' -test_expect_success \ - 'checking lack of COPYING' \ - '! test -f COPYING' +test_expect_success 'checking lack of COPYING' ' + ! test -f COPYING +' -test_expect_success \ - 'checking checking lack of path1/COPYING-TOO' \ - '! test -f path0/COPYING-TOO' +test_expect_success 'checking checking lack of path1/COPYING-TOO' ' + ! test -f path0/COPYING-TOO +' -test_expect_success \ - 'checking lack of path1/path2' \ - '! test -d path1/path2' +test_expect_success 'checking lack of path1/path2' ' + ! test -d path1/path2 +' -test_expect_success \ - 'checking lack of path1' \ - '! test -d path1' +test_expect_success 'checking lack of path1' ' + ! test -d path1 +' test_done diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index 22161b3b2d..fe43f77513 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -107,8 +107,7 @@ test_expect_success 'reset --soft with unmerged index should fail' ' git rm --cached -- un ' -test_expect_success \ - 'giving paths with options different than --mixed should fail' ' +test_expect_success 'giving paths with options different than --mixed should fail' ' test_must_fail git reset --soft -- first && test_must_fail git reset --hard -- first && test_must_fail git reset --soft HEAD^ -- first && @@ -128,8 +127,7 @@ test_expect_success 'giving unrecognized options should fail' ' check_changes $head5 ' -test_expect_success \ - 'trying to do reset --soft with pending merge should fail' ' +test_expect_success 'trying to do reset --soft with pending merge should fail' ' git branch branch1 && git branch branch2 && @@ -152,8 +150,7 @@ test_expect_success \ check_changes $head5 ' -test_expect_success \ - 'trying to do reset --soft with pending checkout merge should fail' ' +test_expect_success 'trying to do reset --soft with pending checkout merge should fail' ' git branch branch3 && git branch branch4 && @@ -175,8 +172,7 @@ test_expect_success \ check_changes $head5 ' -test_expect_success \ - 'resetting to HEAD with no changes should succeed and do nothing' ' +test_expect_success 'resetting to HEAD with no changes should succeed and do nothing' ' git reset --hard && check_changes $head5 && git reset --hard HEAD && @@ -226,8 +222,7 @@ secondfile: 2nd line 2nd file 3rd line 2nd file EOF -test_expect_success \ - 'changing files and redo the last commit should succeed' ' +test_expect_success 'changing files and redo the last commit should succeed' ' echo "3rd line 2nd file" >>secondfile && git commit -a -C ORIG_HEAD && head4=$(git rev-parse --verify HEAD) && @@ -245,8 +240,7 @@ first: second: 2nd file EOF -test_expect_success \ - '--hard reset should change the files and undo commits permanently' ' +test_expect_success '--hard reset should change the files and undo commits permanently' ' git reset --hard HEAD~2 && check_changes $head5p2 && test "$(git rev-parse ORIG_HEAD)" = \ @@ -284,8 +278,7 @@ secondfile: 1st line 2nd file 2nd line 2nd file EOF -test_expect_success \ - 'redoing changes adding them without commit them should succeed' ' +test_expect_success 'redoing changes adding them without commit them should succeed' ' git rm first && git mv second secondfile && @@ -380,8 +373,7 @@ secondfile: 1st line 2nd file 2nd line 2nd file EOF -test_expect_success \ - '--hard reset to ORIG_HEAD should clear a fast-forward merge' ' +test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge' ' git reset --hard HEAD^ && check_changes $head5 && diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 4d62b9b00f..a800bda5e3 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -62,7 +62,7 @@ test_expect_success setup ' git checkout master ' -test_expect_success "checkout from non-existing branch" ' +test_expect_success 'checkout from non-existing branch' ' git checkout -b delete-me master && git update-ref -d --no-deref refs/heads/delete-me && @@ -71,7 +71,7 @@ test_expect_success "checkout from non-existing branch" ' test refs/heads/master = "$(git symbolic-ref HEAD)" ' -test_expect_success "checkout with dirty tree without -m" ' +test_expect_success 'checkout with dirty tree without -m' ' fill 0 1 2 3 4 5 6 7 8 >one && if git checkout side @@ -84,7 +84,7 @@ test_expect_success "checkout with dirty tree without -m" ' ' -test_expect_success "checkout with unrelated dirty tree without -m" ' +test_expect_success 'checkout with unrelated dirty tree without -m' ' git checkout -f master && fill 0 1 2 3 4 5 6 7 8 >same && @@ -95,7 +95,7 @@ test_expect_success "checkout with unrelated dirty tree without -m" ' test_cmp messages.expect messages ' -test_expect_success "checkout -m with dirty tree" ' +test_expect_success 'checkout -m with dirty tree' ' git checkout -f master && git clean -f && @@ -120,7 +120,7 @@ test_expect_success "checkout -m with dirty tree" ' test_must_be_empty current.index ' -test_expect_success "checkout -m with dirty tree, renamed" ' +test_expect_success 'checkout -m with dirty tree, renamed' ' git checkout -f master && git clean -f && @@ -388,22 +388,22 @@ test_expect_success 'checkout specific path while in subdirectory' ' ' -test_expect_success \ - 'checkout w/--track sets up tracking' ' +test_expect_success 'checkout w/--track sets up tracking' ' git config branch.autosetupmerge false && git checkout master && git checkout --track -b track1 && test "$(git config branch.track1.remote)" && - test "$(git config branch.track1.merge)"' + test "$(git config branch.track1.merge)" +' -test_expect_success \ - 'checkout w/autosetupmerge=always sets up tracking' ' +test_expect_success 'checkout w/autosetupmerge=always sets up tracking' ' test_when_finished git config branch.autosetupmerge false && git config branch.autosetupmerge always && git checkout master && git checkout -b track2 && test "$(git config branch.track2.remote)" && - test "$(git config branch.track2.merge)"' + test "$(git config branch.track2.merge)" +' test_expect_success 'checkout w/--track from non-branch HEAD fails' ' git checkout master^0 && @@ -435,8 +435,7 @@ test_expect_success 'detach a symbolic link HEAD' ' test "z$(git rev-parse --verify refs/heads/master)" = "z$here" ' -test_expect_success \ - 'checkout with --track fakes a sensible -b ' ' +test_expect_success 'checkout with --track fakes a sensible -b ' ' git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && git update-ref refs/remotes/origin/koala/bear renamer && @@ -457,9 +456,9 @@ test_expect_success \ test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" ' -test_expect_success \ - 'checkout with --track, but without -b, fails with too short tracked name' ' - test_must_fail git checkout --track renamer' +test_expect_success 'checkout with --track, but without -b, fails with too short tracked name' ' + test_must_fail git checkout --track renamer +' setup_conflicting_index () { rm -f .git/index && From patchwork Sat Oct 17 07:54:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11842675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E9B4C43457 for ; Sat, 17 Oct 2020 07:56:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C78AF2072D for ; Sat, 17 Oct 2020 07:56:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tUCiJdta" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437529AbgJQH4E (ORCPT ); Sat, 17 Oct 2020 03:56:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437522AbgJQH4D (ORCPT ); Sat, 17 Oct 2020 03:56:03 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A878C061755 for ; Sat, 17 Oct 2020 00:56:03 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id n14so2850014pff.6 for ; Sat, 17 Oct 2020 00:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9qW5LCiX3cg+QaZyzahzhwWLREwCttKhkFE7l1/60W8=; b=tUCiJdta3AjeTOLlFd+e26MA3sLF1u5JMQypttQZWgNgkDzDjo5uYaMvyn7BNmtN1r JfmRetMH1327IyyIb6y5X2tNQRWQKJF/TMXEFll9Ca159c4h8zAtEjrkEo2f9bWmyPRc ZaVRuZCvdobvYPSJLAnDQrcINykZ8C/bJw4PxtF6qlMRJN8V0bih184IEsIAyhVe8DsQ Qac6NJ0dsDm6Kqtxjg/33nbGNKGWzcn0BZDGdZu2o+bNlWpa/pTs2YQNlBOJt40k6sNZ kW5lt1Nh9EoiNqmu6noDbr6pjc8y7pU/uclqgwebdIrtnXbb4JX4JqwYHrvp9QDrREQ6 p+Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9qW5LCiX3cg+QaZyzahzhwWLREwCttKhkFE7l1/60W8=; b=jxJw3rGh997o4zFK3ytrE9T2sH4UVok8C+owWXBV4BsQQKZncUzJD7OP2V2BQ7VxCa GLSEh2CLluohkJGqVj58AT7QmCKhgs7SCshGxQw7LRw8dyWoGtitFu/Dk1f7rX/Q+j0Q c0XJMZo1RP2+CT9ljkh0sW1ElAoC1wPqUQjSQpyvWzwjOKSsJaDqmDggKtIodFW8+dOZ 01rvGFcKXHA64VPfXozSMtH8dZ1QYlWN1wfburuaEYR/YmDTibY0oG+pVimI/vz+qQYB VbQKHTYHTWs6uPipARA7zpfexyB20F5D/R01JFu+J19B3JYiUVMoVMFkz6P0P4KErgqr vz9Q== X-Gm-Message-State: AOAM533JgCEO/kqnLJPDfKKiv/vavKlPyP3ULnDoRs16iWXzjgaZuY5S au7Ck7eeye0jPxg+PAOacXzq3M7bl7wYIQ== X-Google-Smtp-Source: ABdhPJyXpXANkvuFj+S6zmxhbfg9bBHx50sSBCQxQOvTIFSsTZjtF+1duUbXxJFccHb6rxAveEztRg== X-Received: by 2002:a63:f741:: with SMTP id f1mr6048981pgk.38.1602921362510; Sat, 17 Oct 2020 00:56:02 -0700 (PDT) Received: from localhost.localdomain ([106.201.2.128]) by smtp.gmail.com with ESMTPSA id t2sm4994162pji.12.2020.10.17.00.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 00:56:02 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v2 2/5][Outreachy] t7102,t7201: remove unnecessary blank spaces in test body Date: Sat, 17 Oct 2020 13:24:52 +0530 Message-Id: <20201017075455.9660-3-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201017075455.9660-1-charvi077@gmail.com> References: <20201015175709.20121-1-charvi077@gmail.com> <20201017075455.9660-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Some tests use a deprecated style in which there are unnecessary blank lines after the opening quote of the test body and before the closing quote. So we should remove these unnecessary blank lines. Signed-off-by: Charvi Mendiratta --- t/t7102-reset.sh | 9 --------- t/t7201-co.sh | 25 ------------------------- 2 files changed, 34 deletions(-) diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index fe43f77513..2b4cfb2c83 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -439,7 +439,6 @@ test_expect_success 'test --mixed ' ' ' test_expect_success 'test resetting the index at give paths' ' - mkdir sub && >sub/file1 && >sub/file2 && @@ -452,7 +451,6 @@ test_expect_success 'test resetting the index at give paths' ' echo "$U" && test_must_fail git diff-index --cached --exit-code "$T" && test "$T" != "$U" - ' test_expect_success 'resetting an unmodified path is a no-op' ' @@ -490,7 +488,6 @@ test_expect_success 'resetting specific path that is unmerged' ' ' test_expect_success 'disambiguation (1)' ' - git reset --hard && >secondfile && git add secondfile && @@ -499,11 +496,9 @@ test_expect_success 'disambiguation (1)' ' test -z "$(git diff --cached --name-only)" && test -f secondfile && test_must_be_empty secondfile - ' test_expect_success 'disambiguation (2)' ' - git reset --hard && >secondfile && git add secondfile && @@ -511,11 +506,9 @@ test_expect_success 'disambiguation (2)' ' test_must_fail git reset secondfile && test -n "$(git diff --cached --name-only -- secondfile)" && test ! -f secondfile - ' test_expect_success 'disambiguation (3)' ' - git reset --hard && >secondfile && git add secondfile && @@ -524,11 +517,9 @@ test_expect_success 'disambiguation (3)' ' test_must_fail git diff --quiet && test -z "$(git diff --cached --name-only)" && test ! -f secondfile - ' test_expect_success 'disambiguation (4)' ' - git reset --hard && >secondfile && git add secondfile && diff --git a/t/t7201-co.sh b/t/t7201-co.sh index a800bda5e3..b527f8009c 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -33,7 +33,6 @@ fill () { test_expect_success setup ' - fill x y z > same && fill 1 2 3 4 5 6 7 8 >one && fill a b c d e >two && @@ -63,7 +62,6 @@ test_expect_success setup ' ' test_expect_success 'checkout from non-existing branch' ' - git checkout -b delete-me master && git update-ref -d --no-deref refs/heads/delete-me && test refs/heads/delete-me = "$(git symbolic-ref HEAD)" && @@ -72,7 +70,6 @@ test_expect_success 'checkout from non-existing branch' ' ' test_expect_success 'checkout with dirty tree without -m' ' - fill 0 1 2 3 4 5 6 7 8 >one && if git checkout side then @@ -81,11 +78,9 @@ test_expect_success 'checkout with dirty tree without -m' ' else echo "happy - failed correctly" fi - ' test_expect_success 'checkout with unrelated dirty tree without -m' ' - git checkout -f master && fill 0 1 2 3 4 5 6 7 8 >same && cp same kept && @@ -96,7 +91,6 @@ test_expect_success 'checkout with unrelated dirty tree without -m' ' ' test_expect_success 'checkout -m with dirty tree' ' - git checkout -f master && git clean -f && @@ -121,7 +115,6 @@ test_expect_success 'checkout -m with dirty tree' ' ' test_expect_success 'checkout -m with dirty tree, renamed' ' - git checkout -f master && git clean -f && fill 1 2 3 4 5 7 8 >one && @@ -139,11 +132,9 @@ test_expect_success 'checkout -m with dirty tree, renamed' ' ! test -f one && git diff --cached >current && test_must_be_empty current - ' test_expect_success 'checkout -m with merge conflict' ' - git checkout -f master && git clean -f && fill 1 T 3 4 5 6 S 8 >one && @@ -166,7 +157,6 @@ test_expect_success 'checkout -m with merge conflict' ' ' test_expect_success 'format of merge conflict from checkout -m' ' - git checkout -f master && git clean -f && fill b d > two && @@ -190,7 +180,6 @@ test_expect_success 'format of merge conflict from checkout -m' ' ' test_expect_success 'checkout --merge --conflict=diff3 ' ' - git checkout -f master && git reset --hard && git clean -f && fill b d > two && @@ -216,7 +205,6 @@ test_expect_success 'checkout --merge --conflict=diff3 ' ' ' test_expect_success 'switch to another branch while carrying a deletion' ' - git checkout -f master && git reset --hard && git clean -f && git rm two && @@ -228,7 +216,6 @@ test_expect_success 'switch to another branch while carrying a deletion' ' ' test_expect_success 'checkout to detach HEAD (with advice declined)' ' - git config advice.detachedHead false && rev=$(git rev-parse --short renamer^) && git checkout -f renamer && git clean -f && @@ -267,7 +254,6 @@ test_expect_success 'checkout to detach HEAD' ' ' test_expect_success 'checkout to detach HEAD with branchname^' ' - git checkout -f master && git clean -f && git checkout renamer^ && H=$(git rev-parse --verify HEAD) && @@ -283,7 +269,6 @@ test_expect_success 'checkout to detach HEAD with branchname^' ' ' test_expect_success 'checkout to detach HEAD with :/message' ' - git checkout -f master && git clean -f && git checkout ":/Initial" && H=$(git rev-parse --verify HEAD) && @@ -299,7 +284,6 @@ test_expect_success 'checkout to detach HEAD with :/message' ' ' test_expect_success 'checkout to detach HEAD with HEAD^0' ' - git checkout -f master && git clean -f && git checkout HEAD^0 && H=$(git rev-parse --verify HEAD) && @@ -315,7 +299,6 @@ test_expect_success 'checkout to detach HEAD with HEAD^0' ' ' test_expect_success 'checkout with ambiguous tag/branch names' ' - git tag both side && git branch both master && git reset --hard && @@ -327,11 +310,9 @@ test_expect_success 'checkout with ambiguous tag/branch names' ' test "z$H" = "z$M" && name=$(git symbolic-ref HEAD 2>/dev/null) && test "z$name" = zrefs/heads/both - ' test_expect_success 'checkout with ambiguous tag/branch names' ' - git reset --hard && git checkout master && @@ -351,11 +332,9 @@ test_expect_success 'checkout with ambiguous tag/branch names' ' else : happy fi - ' test_expect_success 'switch branches while in subdirectory' ' - git reset --hard && git checkout master && @@ -366,11 +345,9 @@ test_expect_success 'switch branches while in subdirectory' ' ) && ! test -f subs/one && rm -fr subs - ' test_expect_success 'checkout specific path while in subdirectory' ' - git reset --hard && git checkout side && mkdir subs && @@ -385,7 +362,6 @@ test_expect_success 'checkout specific path while in subdirectory' ' git checkout side -- bero ) && test -f subs/bero - ' test_expect_success 'checkout w/--track sets up tracking' ' @@ -608,7 +584,6 @@ test_expect_success 'failing checkout -b should not break working tree' ' test $(git symbolic-ref HEAD) = refs/heads/master && git diff --exit-code && git diff --cached --exit-code - ' test_expect_success 'switch out of non-branch' ' From patchwork Sat Oct 17 07:54:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11842683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3FFAC433DF for ; Sat, 17 Oct 2020 07:56:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9100A2073A for ; Sat, 17 Oct 2020 07:56:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="juh1PVEK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437532AbgJQH4H (ORCPT ); Sat, 17 Oct 2020 03:56:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437522AbgJQH4H (ORCPT ); Sat, 17 Oct 2020 03:56:07 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FEDEC061755 for ; Sat, 17 Oct 2020 00:56:07 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id f5so2827260pgb.1 for ; Sat, 17 Oct 2020 00:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F9M+sC/fUMUcK8OC/Q0UqFPEUFeZngOB95nFh6yS8UA=; b=juh1PVEKJLVpLQgpoQoNkDh3AlWJqmEkVTblPDvu6uiwTPSwKf3ZO+GFiPqOxwrrjz dVQqq4tqYew9vvA1RiJBAKXf4cg0T5mpb9xewILDW0BItk48wKFw+LYsd1QoMixfDR// yqfci3ajYAVa2OTTGW2SjCbHi+N804s99Wjyec6i+W+A7diWUt6JJ+An1p33M52/LJdQ qoZ9YduE8yYMCtExaP0Z3KIaAZU7jjaVfQaznpDQPDjLtm58YvDtpNc76o/ZGUlO2ScY 0nEL7zm1+Bt7IRZZMlAi9FqDE2Sgc6N0wqj2dG2hVOpuL1mBeTaO9xLX5jPNtPI+1OIM CG7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F9M+sC/fUMUcK8OC/Q0UqFPEUFeZngOB95nFh6yS8UA=; b=Xo7JYQsSI9FpiAcRRuAShs7MhldK/jsKshsNV4Q0pIqhEaepbhNLltH8Tjxv62Xe4W USc3XrckPSGnRLKv1N8UybNyZDlhRRgmnIABnEyIqYd4+K0bHvEhiE4Gpkn3VKFTTWxg NWD6a2+zzOWapoezEwniS5P8fgax9KfYx/29Kya3kVKEeDz/Dy3Q88A6qIiaPXOGEFaN dpIYa2RGeiXfUXbJCqPgjNBfyfynt6h3Hi5SbjMNSHxAFpZrRvnKAxLHNLnuofi+HJjL 8tfa0YjZDnsSQMrROFO6UenZ66o724juIAXAXan9w3sKmvYgJr7kEm9s+KUCUMUyek9y Yt0A== X-Gm-Message-State: AOAM533IWRcflhiOIsTv7bbIwlAk9VKlqyHVicY9mYdL4Ugc4/NvJWtZ bQP+31OTfD8Rz0svdVF5/Jx87N0oNyDr0Q== X-Google-Smtp-Source: ABdhPJx64q/Oo8NUWxH9n1GjqNxMBIF4cJE3/xPQ/O3ctU068YBwoK3S5awIWrFGjM2JlM7zy/sOvA== X-Received: by 2002:a62:8389:0:b029:152:416d:f026 with SMTP id h131-20020a6283890000b0290152416df026mr7857105pfe.64.1602921366687; Sat, 17 Oct 2020 00:56:06 -0700 (PDT) Received: from localhost.localdomain ([106.201.2.128]) by smtp.gmail.com with ESMTPSA id t2sm4994162pji.12.2020.10.17.00.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 00:56:06 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v2 3/5][Outreachy] t7102,t7201: remove whitespace after redirect operator Date: Sat, 17 Oct 2020 13:24:53 +0530 Message-Id: <20201017075455.9660-4-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201017075455.9660-1-charvi077@gmail.com> References: <20201015175709.20121-1-charvi077@gmail.com> <20201017075455.9660-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org According to Documentation/CodingGuidelines, there should be no whitespace after redirect operators. So, we should remove these whitespaces after redirect operators. Signed-off-by: Charvi Mendiratta --- t/t7102-reset.sh | 30 +++++++++++++++--------------- t/t7201-co.sh | 10 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index 2b4cfb2c83..a8c96bf162 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -70,15 +70,15 @@ check_changes () { test_expect_success 'reset --hard message' ' hex=$(git log -1 --format="%h") && - git reset --hard > .actual && - echo HEAD is now at $hex $(commit_msg) > .expected && + git reset --hard >.actual && + echo HEAD is now at $hex $(commit_msg) >.expected && test_i18ncmp .expected .actual ' test_expect_success 'reset --hard message (ISO8859-1 logoutputencoding)' ' hex=$(git log -1 --format="%h") && - git -c "i18n.logOutputEncoding=$test_encoding" reset --hard > .actual && - echo HEAD is now at $hex $(commit_msg $test_encoding) > .expected && + git -c "i18n.logOutputEncoding=$test_encoding" reset --hard >.actual && + echo HEAD is now at $hex $(commit_msg $test_encoding) >.expected && test_i18ncmp .expected .actual ' @@ -387,25 +387,25 @@ test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge ' test_expect_success 'test --mixed ' ' - echo 1 > file1 && - echo 2 > file2 && + echo 1 >file1 && + echo 2 >file2 && git add file1 file2 && test_tick && git commit -m files && before1=$(git rev-parse --short HEAD:file1) && before2=$(git rev-parse --short HEAD:file2) && git rm file2 && - echo 3 > file3 && - echo 4 > file4 && - echo 5 > file1 && + echo 3 >file3 && + echo 4 >file4 && + echo 5 >file1 && after1=$(git rev-parse --short $(git hash-object file1)) && after4=$(git rev-parse --short $(git hash-object file4)) && git add file1 file3 file4 && git reset HEAD -- file1 file2 file3 && test_must_fail git diff --quiet && - git diff > output && + git diff >output && - cat > expect <<-EOF && + cat >expect <<-EOF && diff --git a/file1 b/file1 index $before1..$after1 100644 --- a/file1 @@ -423,9 +423,9 @@ test_expect_success 'test --mixed ' ' EOF test_cmp expect output && - git diff --cached > output && + git diff --cached >output && - cat > cached_expect <<-EOF && + cat >cached_expect <<-EOF && diff --git a/file4 b/file4 new file mode 100644 index 0000000..$after4 @@ -460,14 +460,14 @@ test_expect_success 'resetting an unmodified path is a no-op' ' git diff-index --cached --exit-code HEAD ' -cat > expect << EOF +cat >expect << EOF Unstaged changes after reset: M file2 EOF test_expect_success '--mixed refreshes the index' ' echo 123 >> file2 && - git reset --mixed HEAD > output && + git reset --mixed HEAD >output && test_i18ncmp expect output ' diff --git a/t/t7201-co.sh b/t/t7201-co.sh index b527f8009c..74553f991b 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -33,7 +33,7 @@ fill () { test_expect_success setup ' - fill x y z > same && + fill x y z >same && fill 1 2 3 4 5 6 7 8 >one && fill a b c d e >two && git add same one two && @@ -55,7 +55,7 @@ test_expect_success setup ' git checkout -b simple master && rm -f one && - fill a c e > two && + fill a c e >two && git commit -a -m "Simple D one, M two" && git checkout master @@ -95,7 +95,7 @@ test_expect_success 'checkout -m with dirty tree' ' git clean -f && fill 0 1 2 3 4 5 6 7 8 >one && - git checkout -m side > messages && + git checkout -m side >messages && test "$(git symbolic-ref HEAD)" = "refs/heads/side" && @@ -159,7 +159,7 @@ test_expect_success 'checkout -m with merge conflict' ' test_expect_success 'format of merge conflict from checkout -m' ' git checkout -f master && git clean -f && - fill b d > two && + fill b d >two && git checkout -m simple && git ls-files >current && @@ -182,7 +182,7 @@ test_expect_success 'format of merge conflict from checkout -m' ' test_expect_success 'checkout --merge --conflict=diff3 ' ' git checkout -f master && git reset --hard && git clean -f && - fill b d > two && + fill b d >two && git checkout --merge --conflict=diff3 simple && cat <<-EOF >expect && From patchwork Sat Oct 17 07:54:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11842679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 658D5C433E7 for ; Sat, 17 Oct 2020 07:56:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 218EF2072D for ; Sat, 17 Oct 2020 07:56:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ljF8g+4+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437537AbgJQH4M (ORCPT ); Sat, 17 Oct 2020 03:56:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437534AbgJQH4M (ORCPT ); Sat, 17 Oct 2020 03:56:12 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF704C0613D3 for ; Sat, 17 Oct 2020 00:56:10 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id y1so2454918plp.6 for ; Sat, 17 Oct 2020 00:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IrSQHAG8PqG1zbLYKHzlWEDMNNUxrGjf+XNdVL2DXSc=; b=ljF8g+4+nQZnHLwFVSsagFiqyEmxsIesKP9cTvs/9QacaPcfOobp6fLoBe1SNHvE4F VtSH7LTpmI3BJV3k8foI0YKm17+imDnmmd5PfBR79+Zh7+E4HmniTEq+YWv1kMTxYjF4 iL9pB/BCnyo4tLP/TST6nxoMYUeN4k7U5UWJzXxDrVr+4gXnQJqh9xPYi/AyaPaLGPFd BKRQDa07wXXQnzoH6QKsJ/8f95kfAgOZxIkGJH0nYHtp0Zivkb3TiT4RKkM7PmKfiT9s GTm5TcTERo7nvMXBtmszLMHQysFm8UVULHlNRPybbsKFHlWVdIZAZFF1oETR9ERMA8vx BaYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IrSQHAG8PqG1zbLYKHzlWEDMNNUxrGjf+XNdVL2DXSc=; b=uf3rvewPB1mwkQNdkPwqsDnsv2F1WLOUvVtmg5MdlCO+8DlP8qHZTSG89EihIEvDlg Po4dKamnWwQ6TF5kL/am3jE3guljf0MOJMfPasdWawi2zeEmDF8e5kCjZTtouy5UHwey 4kzT2nwlCGXZSPLb3rt5q8FbZsTl3vS2eQNlCT5oMqotOkPxtW8+bH/KL5XXefenZCvV abLYVv5uBLTiod3TFN7o3lFznIevAOKHstf1E/o8egJBB2tmojFaF7uddyuxaDCH7FLo dRHWsokwtJjVErEwrT03lAMSENp/jC1SOrLnS9V5H5e13J+wrNngDTKPBqfOcNH4SCOB MIlA== X-Gm-Message-State: AOAM530xTChPjtkSyQzgqVc/pTS94km+P3q0N9KCostusHldFDITwjGi ll4vtoYZncPWDusniXb0nUGfXQMQKbOP8A== X-Google-Smtp-Source: ABdhPJz5/FZDXRuA+0joNifVqWU2fn9XzuPjS3d9XHw1KO/hjS1ppcXpVVOuM8EF6qW8dFBS+UtHlw== X-Received: by 2002:a17:902:7611:b029:d4:da66:f26c with SMTP id k17-20020a1709027611b02900d4da66f26cmr7894721pll.3.1602921370195; Sat, 17 Oct 2020 00:56:10 -0700 (PDT) Received: from localhost.localdomain ([106.201.2.128]) by smtp.gmail.com with ESMTPSA id t2sm4994162pji.12.2020.10.17.00.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 00:56:09 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v2 4/5][Outreachy] t7201: avoid using cd outside of subshells Date: Sat, 17 Oct 2020 13:24:54 +0530 Message-Id: <20201017075455.9660-5-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201017075455.9660-1-charvi077@gmail.com> References: <20201015175709.20121-1-charvi077@gmail.com> <20201017075455.9660-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Avoid using `cd` outside of subshells since, if the test fails, there is no guarantee that the current working directory is the expected one, which may cause subsequent tests to run in the wrong directory. Signed-off-by: Charvi Mendiratta --- t/t7201-co.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 74553f991b..5898182fd2 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -339,10 +339,7 @@ test_expect_success 'switch branches while in subdirectory' ' git checkout master && mkdir subs && - ( - cd subs && - git checkout side - ) && + git -C subs checkout side && ! test -f subs/one && rm -fr subs ' @@ -357,10 +354,7 @@ test_expect_success 'checkout specific path while in subdirectory' ' git checkout master && mkdir -p subs && - ( - cd subs && - git checkout side -- bero - ) && + git -C subs checkout side -- bero && test -f subs/bero ' From patchwork Sat Oct 17 07:54:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11842681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 028C1C43457 for ; Sat, 17 Oct 2020 07:56:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A570A2072D for ; Sat, 17 Oct 2020 07:56:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m513KdP8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437542AbgJQH4P (ORCPT ); Sat, 17 Oct 2020 03:56:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437534AbgJQH4O (ORCPT ); Sat, 17 Oct 2020 03:56:14 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1672CC061755 for ; Sat, 17 Oct 2020 00:56:14 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id j8so2751227pjy.5 for ; Sat, 17 Oct 2020 00:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FFSD8VrsC0mgWb6PkiATTATFMdZzcAICEjAXPCadm4s=; b=m513KdP8tfnGWt/T0erqKjqaV72gpSP13Isir7qde1auyMW0syH8zi76U9ZsA4Hq0l PRzAcIgYE78CMMFP5hwShWpCdr7MYRMzex797E7fSyIG/bXqHWembK+O57+mJ4yTakmR rC4gpcG0wP9VAO9fLcTPH85NZVWdLabGBAns/KKT4HIt9vw8GMlSGVzgdfXuBmKtBof5 TAjaPjxXP0FufZzp3owaDQ1zro3xPhjJlmPKdeacoyFI7j2LQTZp7dVUFAfcm6PgY4wi 04oeut8YZgY2bcMohtANZ5j7TcnHTURKweCqMZOY1FwozpWy4Bq7U2CgEirWcGH3K20f ev0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FFSD8VrsC0mgWb6PkiATTATFMdZzcAICEjAXPCadm4s=; b=WAyeKAMqlhkHCIMRxvk2NziW39shCn6pHfIad6laq3WYwSmqlNNwptoA/sSB0A16mw BRdJV9ikwMWcqTX5GW8SZuWxKMbR+FgrtQQO90361up6jGnvoGBEWnq1ciK1Gisv+r2Z 7jjviG5GS46Kdw7EcfiPpo7EtIJY97tkfnWLHmqQM1/Lw8XvWFcowRNqtqyH+QVdIRP5 rpWk5ejz1WGZtqOPOdvEcvV+NRzC2ZpiwzOUerc46B540qJL6MciM3xk0/4niNbQK+tt TG59/j/PUSVmqIoLUJGc5+c8ioLwu/n2LApFMEmEmWYfUvvP0S/1a+5pECzgH/y7C1Sx w+YQ== X-Gm-Message-State: AOAM532FEeIPyvWg8TGWTu/Ff36PTnCSlDIe0YlTiU9/OReevz8rcJZ4 f443oTjIOz/i1zBQD91d+I/60CTQaTfJiA== X-Google-Smtp-Source: ABdhPJxYdtmr8mV9+XvOJyZXIL7Z7S32p9AX4lL356B/RRGsQfpEoEGHB7pqJ5LkcJDn4S8l7w9nsA== X-Received: by 2002:a17:90a:aa18:: with SMTP id k24mr7799214pjq.231.1602921373428; Sat, 17 Oct 2020 00:56:13 -0700 (PDT) Received: from localhost.localdomain ([106.201.2.128]) by smtp.gmail.com with ESMTPSA id t2sm4994162pji.12.2020.10.17.00.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 00:56:13 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v2 5/5][Outreachy] t7201: place each command in its own line Date: Sat, 17 Oct 2020 13:24:55 +0530 Message-Id: <20201017075455.9660-6-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201017075455.9660-1-charvi077@gmail.com> References: <20201015175709.20121-1-charvi077@gmail.com> <20201017075455.9660-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Multiple commands on one line should be split across multiple lines. Signed-off-by: Charvi Mendiratta --- t/t7201-co.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 5898182fd2..b36a93056f 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -157,7 +157,8 @@ test_expect_success 'checkout -m with merge conflict' ' ' test_expect_success 'format of merge conflict from checkout -m' ' - git checkout -f master && git clean -f && + git checkout -f master && + git clean -f && fill b d >two && git checkout -m simple && @@ -180,7 +181,9 @@ test_expect_success 'format of merge conflict from checkout -m' ' ' test_expect_success 'checkout --merge --conflict=diff3 ' ' - git checkout -f master && git reset --hard && git clean -f && + git checkout -f master && + git reset --hard && + git clean -f && fill b d >two && git checkout --merge --conflict=diff3 simple && @@ -205,7 +208,9 @@ test_expect_success 'checkout --merge --conflict=diff3 ' ' ' test_expect_success 'switch to another branch while carrying a deletion' ' - git checkout -f master && git reset --hard && git clean -f && + git checkout -f master && + git reset --hard && + git clean -f && git rm two && test_must_fail git checkout simple 2>errs && @@ -218,7 +223,8 @@ test_expect_success 'switch to another branch while carrying a deletion' ' test_expect_success 'checkout to detach HEAD (with advice declined)' ' git config advice.detachedHead false && rev=$(git rev-parse --short renamer^) && - git checkout -f renamer && git clean -f && + git checkout -f renamer && + git clean -f && git checkout renamer^ 2>messages && test_i18ngrep "HEAD is now at $rev" messages && test_line_count = 1 messages && @@ -237,7 +243,8 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' ' test_expect_success 'checkout to detach HEAD' ' git config advice.detachedHead true && rev=$(git rev-parse --short renamer^) && - git checkout -f renamer && git clean -f && + git checkout -f renamer && + git clean -f && GIT_TEST_GETTEXT_POISON=false git checkout renamer^ 2>messages && grep "HEAD is now at $rev" messages && test_line_count -gt 1 messages && @@ -254,7 +261,8 @@ test_expect_success 'checkout to detach HEAD' ' ' test_expect_success 'checkout to detach HEAD with branchname^' ' - git checkout -f master && git clean -f && + git checkout -f master && + git clean -f && git checkout renamer^ && H=$(git rev-parse --verify HEAD) && M=$(git show-ref -s --verify refs/heads/master) && @@ -269,7 +277,8 @@ test_expect_success 'checkout to detach HEAD with branchname^' ' ' test_expect_success 'checkout to detach HEAD with :/message' ' - git checkout -f master && git clean -f && + git checkout -f master && + git clean -f && git checkout ":/Initial" && H=$(git rev-parse --verify HEAD) && M=$(git show-ref -s --verify refs/heads/master) && @@ -284,7 +293,8 @@ test_expect_success 'checkout to detach HEAD with :/message' ' ' test_expect_success 'checkout to detach HEAD with HEAD^0' ' - git checkout -f master && git clean -f && + git checkout -f master && + git clean -f && git checkout HEAD^0 && H=$(git rev-parse --verify HEAD) && M=$(git show-ref -s --verify refs/heads/master) &&