From patchwork Wed Oct 21 12:48:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11849031 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 3A4D3C388F9 for ; Wed, 21 Oct 2020 12:50:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1ED42224E for ; Wed, 21 Oct 2020 12:50:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bC1fXf0y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442643AbgJUMuo (ORCPT ); Wed, 21 Oct 2020 08:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442640AbgJUMuo (ORCPT ); Wed, 21 Oct 2020 08:50:44 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B321C0613CE for ; Wed, 21 Oct 2020 05:50:44 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id m3so12175pjf.4 for ; Wed, 21 Oct 2020 05:50:44 -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=bC1fXf0yzfU9qQHLd85A4XgXrXeufgRxn7mpsH9Iub92RW5H7MgCwrTMKx25oUObp1 1mnsl7MzCWTNeQSDraq9IZxNLasJ2kt6RT1pfwt5qpDIFFdLUXArwu38u3iSGcspZr/X HRbcuFKkhQLdgxKPwlVxcI+zKQ/H6NdZCxiPCFRTgHsiusgzkd+WhHC3jY5ZYDWxO6e7 wcYgjlKB95D79tV0GxNnEkIb+QXR3eXaoiFiv/MRoDPor44RT54zdSVFoteBZ4VbEByg I1CutJVIpC7rRyph8R16iJ3GgjVBwpJgrMCVtP7poIHuLc5FglrdYqaiZ8d7yRLW+gra 8ANw== 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=OpP4AcOhDOc2BbkxUQOXkymm/+l7uHHeDOmtJXWn/tmx+KNB3LnGgF4YNfUObcp2Xu QHTjqhw8gd0r6zHpUNy7OS9r2zbtcslqlWeGb4QbUkTV0JX6PmUhEUqsnvQFsMr0NdVy zyWbP2wiBCewWc2H1vDkjLmP5qJYW7ABTMPnMLXWRIUV2cjGsjXUc+jbddTFrSMy/Irc sbMtyw4aeYaVp5Rm7eiYKw7SI9JD2omYixyGDX9ubi4PV3kFCW2br0tcRbfJb1a90i5C gi6gOC+SrIiuMtaKEj1/lVwuG9cwKZN8hoKbFfN+SvSMZDSGtqao7CN3y0yFWCCPBBL4 QeDA== X-Gm-Message-State: AOAM5322D/5MuChWddJU01QRNtRmN5zFRU98ZVOnRMY8s+k8+ygidfNQ 1Bhuvl8Lncp4yg+sW3x3ps0XOV0PCRcouw== X-Google-Smtp-Source: ABdhPJzctsDoU09Nt3CVrRW8oqZK/eZXFkqN3n7fEDIA3OG6HfBQZTZ7/P+4MhA0jYET0cEwVqDMtg== X-Received: by 2002:a17:90a:c388:: with SMTP id h8mr3289134pjt.100.1603284643559; Wed, 21 Oct 2020 05:50:43 -0700 (PDT) Received: from localhost.localdomain ([106.215.55.55]) by smtp.googlemail.com with ESMTPSA id j24sm2054857pjn.9.2020.10.21.05.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 05:50:43 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, me@ttaylorr.com, phillip.wood123@gmail.com, Charvi Mendiratta Subject: [PATCH v5 1/5][Outreachy] t7101,t7102,t7201: modernize test formatting Date: Wed, 21 Oct 2020 18:18:19 +0530 Message-Id: <20201021124823.2217-2-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201021124823.2217-1-charvi077@gmail.com> References: <20201020121152.21645-1-charvi077@gmail.com> <20201021124823.2217-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 Thu Oct 22 07:16:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11850373 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 6F2CAC4363A for ; Thu, 22 Oct 2020 07:19:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1056D22248 for ; Thu, 22 Oct 2020 07:19:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hdP9+zsJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2506109AbgJVHTx (ORCPT ); Thu, 22 Oct 2020 03:19:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2506099AbgJVHTx (ORCPT ); Thu, 22 Oct 2020 03:19:53 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED803C0613CE for ; Thu, 22 Oct 2020 00:19:52 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id e7so569663pfn.12 for ; Thu, 22 Oct 2020 00:19:52 -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=t3Nz13CDPOpDfLJl00FTEqcUcfeuYsIkYRTXx35epXA=; b=hdP9+zsJ7iqbnhaq9ZCSTJxMtozOUyGLYFjnRP316/d8yI/nDHlaWpj8cjIdsrmL2X oo0L2kr5wWZF6BlgN+IcDL1w5cVBRjF4e/UsTGuAv80Mk14FzS9sSBND30YT27seiRK6 FLROP1Aikwih+gdMEkJzpPbjFoyhL68nOi4stGbCihXitVCQ7CfDqbnsQjAqC6JvJdVD vbsIiljNODfJO1Mx1MhYFOTsgxsVO/EQHiosxmY1G7rWhYf9kLTQ9J/oOI+pK0jBkBiL 6SttrJ4nli2Yp+gLNXtCRSQzsjye0AF46nn8zUmqsfSc9esU/TzbIwaduvlivKsTBB5a P0wQ== 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=t3Nz13CDPOpDfLJl00FTEqcUcfeuYsIkYRTXx35epXA=; b=UTTjIR7LHHtnsm56rlhtxbqmidrYCjKfW6LJU0LbF2LhCzDCnwk3BDXHc26sfUady8 5Z5TBvWm56t8K/TJQKeZgVEZzZ1WM+IHEwkWTRiCNnJ5aw561JgiGvg7cTgIVZgLxm6N 7Zt6z3Pj7Ab+Oa8YkG6dmjAb/l4f/OLkq2wnGUL4o7EBndugZLYxNeVokmDPoA19a7nC oXzcJhrStgCNMOILtNKWho2I5EQnVMuxtpaGWou2oRNOHjpMH3bMrsf3TIn3t3w2oG2r MNMIYWb6z8Mthrm+cG5mBtmRhKpNrn3z0UezPBJ3v4HZDUFDyLqLJaIWUV+/isUBP07H 8bxQ== X-Gm-Message-State: AOAM533L7ZEGIt+Gz/yCFRM055djfx/XXHRicauxD4ucos1GgDTbpsjq n/2fBzdxhzVwei+oApVPrMjYI753ZKEBIg== X-Google-Smtp-Source: ABdhPJxIhLFI2j0OrgXX4zgv34H1lRQ684BPPKvZed1FG2AZZRvHWQO4/3Ms066nAH5nWuqeZiJOSg== X-Received: by 2002:a63:105e:: with SMTP id 30mr1158646pgq.33.1603351192202; Thu, 22 Oct 2020 00:19:52 -0700 (PDT) Received: from localhost.localdomain ([2409:4050:2e84:4e7a:290b:4332:f03e:69aa]) by smtp.googlemail.com with ESMTPSA id 78sm1030004pfz.211.2020.10.22.00.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 00:19:51 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, me@ttaylorr.com, phillip.wood123@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v6 2/5][Outreachy] t7102,t7201: remove unnecessary blank spaces in test body Date: Thu, 22 Oct 2020 12:46:47 +0530 Message-Id: <20201022071649.24284-3-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201021124823.2217-1-charvi077@gmail.com> References: <20201021124823.2217-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org t7102 and t7201 still follow the old style of having blank lines around test body, which is not consistence with our current practice. Let's remove those 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 Thu Oct 22 07:16:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11850369 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 62D0CC4363A for ; Thu, 22 Oct 2020 07:20:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0488022248 for ; Thu, 22 Oct 2020 07:19:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r2wX9cEk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2508379AbgJVHT7 (ORCPT ); Thu, 22 Oct 2020 03:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2506116AbgJVHT7 (ORCPT ); Thu, 22 Oct 2020 03:19:59 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE73DC0613CE for ; Thu, 22 Oct 2020 00:19:58 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id p21so531596pju.0 for ; Thu, 22 Oct 2020 00:19:58 -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=RDMYDGtL9z8GD6okf4rweNFAQdtPwiH4ATiFWRnpQp4=; b=r2wX9cEkCfy0lY1/WFLwINTvpYVn/MyH/qPi95FkbU1vwi6MYBM5Sk0YngwMwVSpwn z41TlmPKdRjpCLzsZiBo53KqHNL1V3u07rpMlNYlRbDw98wZl3WmlhqFVNDuMl+fzUkO aK0kAq1OLeNX3aqAnl6W8LaXJgC2J5bkmsOYdGAphETSYDde76QBMwq0J/ERxnKUTHWE 41p7T7mVgq9kKlmdWFMwuz+T4x1e5/wQnCeBuNWtvZpm/aM8LInkrmWaYsdKTQjP+U4w VkZoXQlNT/CvHxNOeVwan33qJe0INYDTgq79b2g+sqVj9y9wYO3poGmMimoh1RPrdhwM 5dcg== 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=RDMYDGtL9z8GD6okf4rweNFAQdtPwiH4ATiFWRnpQp4=; b=o9OQzxaFZKFZLvRWlpWgF4kTa4nqPI7sQPJvLX/xWV5mKwgpkJlZjyzxxf57S9k3yc EMF6r8+n2MIPNaeAsUyryFyAXPpUGn6hY6+h6TsUXrythZCJtWEr+Bjtlp3tKvKtG6Vc KZTjUUoG+r7bpFNHw2T/CivMXrxeRimkDvjEMRhAaNE4j+QQcG6dbk8pmXGGo1822fa5 cicB20PMnMY1owOlNoD+XZimVqVqfkZlPUa8pJ1ISjQ5EaAcHsBUEoxyBkoEpldgXoa0 2WHKbZUqiCStqgB+r2dNCv7DpXlyar+nqEV+lPChexhCj0weyki9JnrKj+FxmfSDaXQ0 I1XQ== X-Gm-Message-State: AOAM531r0/7mtE9nLFKHFeUTf3fe45YcgSSBxDHJXyZRa8UAP7Y//d24 FFj+XxquCsLMNjA1xOAObfJxy74/uNjh/Q== X-Google-Smtp-Source: ABdhPJwLG0VNhcraxcGZce0zC1lwH9DkUMLhGZsS9VYN2iAuPWJd1n1ZshYxOPvbFQ1ygrluBdwN/g== X-Received: by 2002:a17:90b:3114:: with SMTP id gc20mr1084000pjb.73.1603351198321; Thu, 22 Oct 2020 00:19:58 -0700 (PDT) Received: from localhost.localdomain ([2409:4050:2e84:4e7a:290b:4332:f03e:69aa]) by smtp.googlemail.com with ESMTPSA id 78sm1030004pfz.211.2020.10.22.00.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 00:19:57 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, me@ttaylorr.com, phillip.wood123@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v6 3/5][Outreachy] t7102,t7201: remove whitespace after redirect operator Date: Thu, 22 Oct 2020 12:46:48 +0530 Message-Id: <20201022071649.24284-4-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201021124823.2217-1-charvi077@gmail.com> References: <20201021124823.2217-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org According to Documentation/CodingGuidelines, redirect operator is written with space before, but no space after them. Let's remove these whitespaces after redirect operators. Signed-off-by: Charvi Mendiratta --- t/t7102-reset.sh | 32 ++++++++++++++++---------------- t/t7201-co.sh | 10 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index 2b4cfb2c83..3d190cad0e 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 <> file2 && - git reset --mixed HEAD > output && + echo 123 >>file2 && + 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 Thu Oct 22 07:16:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11850367 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 B4008C4363A for ; Thu, 22 Oct 2020 07:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6808A22248 for ; Thu, 22 Oct 2020 07:20:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AYvxIeeP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2508383AbgJVHUG (ORCPT ); Thu, 22 Oct 2020 03:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440119AbgJVHUG (ORCPT ); Thu, 22 Oct 2020 03:20:06 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CE74C0613CE for ; Thu, 22 Oct 2020 00:20:05 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id y14so567942pfp.13 for ; Thu, 22 Oct 2020 00:20:05 -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=75002kI6Sz9A1VtaOvJzjIf/HZtevb9xw7ms9rpQt+o=; b=AYvxIeePJiUf29P3brJ91Mmk59+vyswLdhsj8x1eIFNWPJRexEV1uuck2mKKiBZSVB 9JQHFwYtqFHGGcWHVkTtjoxZiOqEJVaUBr3lG7A02gnc/oYOObSOphETudfFH1NspVqD ROWDwNGFqd0B4gSZk+jZsiqgtQXw/0yceNFwqAcdN1b8b6NVcsZpDwIb1/XnAaNTAPsL 2G4eBCdbBgF67dplYk+qRWGI6BtuFrNKal1fhoe1ewIO158xX0wdDCG31D60eSLwkcuc +dJWc6OV+RjsSGOTGb/jQj2Kds4wHgNmiADQDw1b2nOe6YoGJbxAFjwUS5xRKswzl93x nGGQ== 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=75002kI6Sz9A1VtaOvJzjIf/HZtevb9xw7ms9rpQt+o=; b=iENcGJsrGEO+P+FvC2/vLWFRTv7JSXvkDsEk1u4Ay6BqFU9ms3rbk4+gWku+uP/Ccp DwINU1pWAApKf3ur6THjVEq9RhPru22dU9BZKbitPhmVJhVi9i4JjTkrUOOt5eo2j/Xe kDDOBy96B59gWqxcTDTfbr72GieGT47DGP2Jzsz5TJ/vqu87DvrJEggclAtkE6r4fAX5 IKCHr6Q+sJNamkGyOxE9Iw+Co27yzWLZzeIRH/ydUCCzffxAkTh3wk821Jh/IMmjLwW3 qMpkAHj2RTPp3NyCAQpdkn72URvV1rYTs9SAFGGb1bG7WdDdP5CiqyyHnSD9jEZIMp0i iUKw== X-Gm-Message-State: AOAM533BVlfwOKmUfs/6XxTxuCXRyKMdsvc0/tSnRhTQPiu2tKXPPx/Y gLNFy/IsSxgs45i+Yq0Qwli+t6shSl0Brg== X-Google-Smtp-Source: ABdhPJy6hHWgXx6THeVzcNilEl5dLXarNClvGQJ8susj1U0MhdWq5J3up1LF/qRXRfGQVVqKxgaVNg== X-Received: by 2002:a63:3c5c:: with SMTP id i28mr915064pgn.166.1603351204730; Thu, 22 Oct 2020 00:20:04 -0700 (PDT) Received: from localhost.localdomain ([2409:4050:2e84:4e7a:290b:4332:f03e:69aa]) by smtp.googlemail.com with ESMTPSA id 78sm1030004pfz.211.2020.10.22.00.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 00:20:04 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, me@ttaylorr.com, phillip.wood123@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v6 4/5][Outreachy] t7201: use 'git -C' to avoid subshell Date: Thu, 22 Oct 2020 12:46:49 +0530 Message-Id: <20201022071649.24284-5-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201021124823.2217-1-charvi077@gmail.com> References: <20201021124823.2217-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 Thu Oct 22 07:16:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11850375 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 1CEA7C4363A for ; Thu, 22 Oct 2020 07:20:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B435D22248 for ; Thu, 22 Oct 2020 07:20:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SMRya+Hm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2508388AbgJVHUK (ORCPT ); Thu, 22 Oct 2020 03:20:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2508385AbgJVHUK (ORCPT ); Thu, 22 Oct 2020 03:20:10 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78AB8C0613CE for ; Thu, 22 Oct 2020 00:20:10 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id n16so395625pgv.13 for ; Thu, 22 Oct 2020 00:20: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=q6NWybie0Yh+VX1qO8s6tAnf9JU7GOn9SLYT0uupmuA=; b=SMRya+Hm//ShVgZEmGj4D1mRuoE5lBPB+r2cAzqaoYWE0TxE3paIRX7hcBYXDjwT// pdJWt1YQiPYHQ6mSKrlVrfeAuH+4HH7P6bDjJ8A/fBXHdQDOUFX8fdwTodbVf8rrMul2 IeT46Y5iGtHWOpQQfDDGj2c7zWTBukmtC8WqCPGqo3bBM2Oc+L1HRhrBc9rIucUUR/VB 5Q1fEhR8tdniTi7wBiDCaIAYMWv/v+383K+zDQd2h8ehAulMpZpEPCKrV05vXDjV5wEG mkr3ryVrNqn9O4hUcYMYgcudkvmV4aTu/CdjYK1QVGNFJFkTL0atISuJGDSF3ehTN5yY XyCA== 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=q6NWybie0Yh+VX1qO8s6tAnf9JU7GOn9SLYT0uupmuA=; b=A0DW+30rYGGJBC7Pt21Sk5L/6uX3TNmlLEpUlyqfG03tyiZwW7kOne/tDZI5X06idf TJIKS8KBUt4/AOsWu1auevBwqkUmJKvHa+I00xgrCVfd1vTYuYeKuKO9xAFwtWrp2LhD tr/30WRjoOKDr1+KyabskIPDfe8C8rhUQ0aHu7zirQH2aiGdRV0TWC9IH3N58GfbuvBc PXGREUtKSefAFZfKM1Zw2XRgAhspn0yYRNGK4dqk17BCtMutH+R/OkXkCLd+U/QGOMX1 ZfkuR3JbR9ZMbBOihUNVgRqkEo1HP2YqCwecuzXTBtel7udAXB5086lX12ruPveE3c2Q aVXQ== X-Gm-Message-State: AOAM5323dwcOSzr29p0vtIdZN/84AhcU671OttX5Nouxm0R5MtIOL/Bq rWAWaBZs36W0/F2DjHsznYIe2+tqboJ0LQ== X-Google-Smtp-Source: ABdhPJx2le7FAfpHR27g3MP60X6+b7c1ohhpeALRHJu5L3JcaB1f7SxWvGr2V+3Kipb+a3AdQvqeLg== X-Received: by 2002:aa7:9048:0:b029:152:883a:9a94 with SMTP id n8-20020aa790480000b0290152883a9a94mr1227731pfo.24.1603351209796; Thu, 22 Oct 2020 00:20:09 -0700 (PDT) Received: from localhost.localdomain ([2409:4050:2e84:4e7a:290b:4332:f03e:69aa]) by smtp.googlemail.com with ESMTPSA id 78sm1030004pfz.211.2020.10.22.00.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 00:20:09 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, me@ttaylorr.com, phillip.wood123@gmail.com, sunshine@sunshineco.com, Charvi Mendiratta Subject: [PATCH v6 5/5][Outreachy] t7201: put each command on a separate line Date: Thu, 22 Oct 2020 12:46:50 +0530 Message-Id: <20201022071649.24284-6-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201021124823.2217-1-charvi077@gmail.com> References: <20201021124823.2217-1-charvi077@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Modern practice is to avoid multiple commands per line, and instead place each command on its own line. 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) &&