From patchwork Tue Oct 20 11:43:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11846423 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 EE215C433E7 for ; Tue, 20 Oct 2020 11:44:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 679192224B for ; Tue, 20 Oct 2020 11:44:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b81VJfZH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393638AbgJTLoB (ORCPT ); Tue, 20 Oct 2020 07:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392736AbgJTLoB (ORCPT ); Tue, 20 Oct 2020 07:44:01 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A36BC061755 for ; Tue, 20 Oct 2020 04:44:01 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id l2so44765pjt.5 for ; Tue, 20 Oct 2020 04:44:01 -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=b81VJfZHrsAN99kGjuJO/I/6ZGQjNWjLaLQ313iZSBDgQFoa0VeUb+3RMTAi83yPFA JitmtEZE/IO1SnvIG5hyg3nSw1rvxVwBcfg6BPob7lOE21pksRzgOMACGnqkSOiehDEN X1qCuZVyxBqUomQ5bqPe92Qb1SbQLVFsVIHreprOM1Z/YZx2fmHqB3VRv/9fCAIJO4n8 1Yfe9W8yPvGivaFxbfVdijO4vXRyUBDCVMNoldaVUbisPEG3FNLUte3lgaC5rFMsmBMl BzbOXYepjvzjJ76R/ot40otPItdonAv8vMUKQW2jQiQ9ucNUAOc4kJTLTmSdNV0XidQT vGxQ== 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=DlniInapOufA//fhNEFcOkRIA21V/bJYVk3hayGnlf/mCe67SXN/KHhtCYwoEOwNAT cxgajjsOcjZvt0pWofQh8x091ZdywjqMXqkTVspNnDZa0jChTE9xMEIrUcBIv4JKxUKu tov5Hhq5vXY/Cia7tj49Rjiru8Qj1PpL/ixz3OFNfpSds+mZckZ+cJTrtacwBsE4JnHb 2/wdmMlJoxhlcgKzG6B7jQ/yKU0g0di/pv/ueGjjUcceCmL1qrRf+NBVSb4SMygpOZH9 0zJh+sX6dmtzYRCdkhqbgMEId7Sj2UcbP0Q/amJN3iWcr70zYXyQKlND2TbtTrco/2TW WCSg== X-Gm-Message-State: AOAM531CBf77A7qKKViByNCfn06U5h4mFu459mpef6U2M50RO6ELSn1G 5hHO9+JN9b/cMlMOZ+C8yCOjkqbU6sl5A2xN X-Google-Smtp-Source: ABdhPJxaD7q7jhboBlSrVnRIPFHUOLfuDO3HqsEjouB09+8OyNNmxR9FkKOcejhv6OjHaiOWeZ0izw== X-Received: by 2002:a17:902:a514:b029:d5:b93c:3de1 with SMTP id s20-20020a170902a514b02900d5b93c3de1mr2756862plq.42.1603194240212; Tue, 20 Oct 2020 04:44:00 -0700 (PDT) Received: from localhost.localdomain ([106.215.55.55]) by smtp.gmail.com with ESMTPSA id y22sm2204615pfr.62.2020.10.20.04.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 04:43:59 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, phillip.wood123@gmail.com, congdanhqx@gmail.com, me@ttaylorr.com, Charvi Mendiratta Subject: [PATCH v3 1/5][Outreachy] t7101,t7102,t7201: modernize test formatting Date: Tue, 20 Oct 2020 17:13:15 +0530 Message-Id: <20201020114319.18245-2-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201020114319.18245-1-charvi077@gmail.com> References: <20201017075455.9660-1-charvi077@gmail.com> <20201020114319.18245-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 Tue Oct 20 11:43:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11846427 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 E6C9BC433E7 for ; Tue, 20 Oct 2020 11:44:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 815162224B for ; Tue, 20 Oct 2020 11:44:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IQJiHk33" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393644AbgJTLoG (ORCPT ); Tue, 20 Oct 2020 07:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393639AbgJTLoG (ORCPT ); Tue, 20 Oct 2020 07:44:06 -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 20F99C061755 for ; Tue, 20 Oct 2020 04:44:06 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id kk5so305686pjb.1 for ; Tue, 20 Oct 2020 04:44:06 -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=IQJiHk33wXwJazcx8kTvhPOsO2raB4ZcD0ieC1DQ45ZBQzuLJ1RY3gyZhKO9k/Gl// DVjdfFGCNjZh2I4cDTcr31ErDfT3JFBkBr2XicRjJr9r1Z8MVK0QkscpUgYnKtLpgG9a 6aHidZyxPix/hUzNzuwLMP0B5ItHK/aUfMlzewZ2KTAOmZtCQkEJ/56LYVvL3noQA6yf UW2LmTYjEpHHkbz5aLnnr9BYbGE8mvyzWAQCtyVw19ySpiEli2BI5YIClXvpV1NUgHFN u2SpMnh9/9VJGS8cna3CXUxzItnEMUXHkH+49nDL3TD9VnU1H3nEVM/r7UlcIaTfo4Ug 97Bg== 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=dXJCL0bixhFWAni+hbOYwqnLBEHPmTrHX6jJQoK/APSX77wgH+4zCAgfDl5Bs2ebSf 9YOqDcJGW/8+OVg7r3d2HD6dBqbKOEAvtMXCTNsjjUjcEeMj5W+gSX+PBuTd4X6BTcV/ 7fg1q7jivQanyJW2tDcfvlHwVez0myef6yB+GGtZlCTXS0FOK07XA/cCQ0gGWYFGzFpa U/JyYI16mZdC2VywSJVUFkomX+VsrJWN+frV3/ftSdKOe2B4Z+Fuz0OJGDlIMqYFNReM 4mKktArGkG4IBxYvNHuQ8nmyhmDW3btIKdCtC6jHU+aUU99FVc1X4oQXJytQs/3o4C8N PeYw== X-Gm-Message-State: AOAM533fs1ixVtAXuJxJ//fFDvMWWRNNqrUI/Z/pV5iZCJnxf9iJeYFX Oy4BR+uCWrJL39dVQV5hr8mqS/48GLHiH5EY X-Google-Smtp-Source: ABdhPJy63hMOQz2AFNzHxXu2wZXnWp2ocAE9l58tsgx2qTbRxZ5mBufS7FiHvUDDk4D+D9iQxlAIvg== X-Received: by 2002:a17:90a:9313:: with SMTP id p19mr2423361pjo.90.1603194245424; Tue, 20 Oct 2020 04:44:05 -0700 (PDT) Received: from localhost.localdomain ([106.215.55.55]) by smtp.gmail.com with ESMTPSA id y22sm2204615pfr.62.2020.10.20.04.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 04:44:05 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, phillip.wood123@gmail.com, congdanhqx@gmail.com, me@ttaylorr.com, Charvi Mendiratta Subject: [PATCH v3 2/5][Outreachy] t7102,t7201: remove unnecessary blank spaces in test body Date: Tue, 20 Oct 2020 17:13:16 +0530 Message-Id: <20201020114319.18245-3-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201020114319.18245-1-charvi077@gmail.com> References: <20201017075455.9660-1-charvi077@gmail.com> <20201020114319.18245-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 Tue Oct 20 11:43:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11846429 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 9F1F8C433E7 for ; Tue, 20 Oct 2020 11:44:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 562012224B for ; Tue, 20 Oct 2020 11:44:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XIHn2+aa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393731AbgJTLoL (ORCPT ); Tue, 20 Oct 2020 07:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393645AbgJTLoL (ORCPT ); Tue, 20 Oct 2020 07:44:11 -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 A923EC061755 for ; Tue, 20 Oct 2020 04:44:10 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id e15so1036619pfh.6 for ; Tue, 20 Oct 2020 04:44: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=xQDLRFW4FiYAUG6yGXSGbCtCgG6dpFRXFikvWvF4lr0=; b=XIHn2+aaISao+OcIkwJaurydAGLWW3KjCJnUjpvuRD9VHT0R2PX8OpZTm/B4+vKcTF so0L5g99lMJORUmspyaBLfHrEtnewG8zocM4O1Rj96HaY0alittVc/PQtW+/oMIP12TY fvxo23A8VcfttP1hkaD2ZlrFixwj/NQgYgAqMm6aAXB6NzQXH5U9ATeNMctnbfsLBxEN PnVwjH8cEjzwldpG3WTQqxX7PBfVRmHeVlXeK+w31CR3+bMF8+YulLHs9Ne0FVYmjrzQ 9CODrUrjpLidhVHePA/1taY8T/tNs2L1TUCuc/FmNEwCjTUpLbjYhH+z5jpriH3iegJQ 4Asg== 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=xQDLRFW4FiYAUG6yGXSGbCtCgG6dpFRXFikvWvF4lr0=; b=ap3RkrY12WsADjovarTinbOSy/0cSh/AbjPmxjRe/OXqc8YL2lnYj0HhCP1eMt3yQ9 Sd2lr9ZnlUZwfatLaEjFw92msVyR4vKsc0D52G87LxEGdh6kxGnuHVVp3Icrk6N3SV9c pscOCV0CBvVa9ZnrqZ69YLTIW7sqSTPqJyibJPp5TZBjCsNbSz7N3AiP8Lt4+dZoMFaw ukzRQJwZqf2/5jn1Uz6yjBm94qLRbVyjqaK8KIf7F7VKFu281slSrDidiHd1n1pOCJBG pQQ6pqHF0V/7N88KBNvZDBNYvVS+P0apO4h9ZcP4yHU0yv/+yhtf5iVu56I4KZRNTHk5 JPdA== X-Gm-Message-State: AOAM531WXsdQdygtkfli4Q5tElFqxkeGDyRVaJBBXKW5KdvFylW6QYse 3XHxyAeN/AQ+V7cd+aM4bLy/Yh0X3cb0jenn X-Google-Smtp-Source: ABdhPJzy428TqLTJygn4lVfs8h0k5EjkCOEehN/2TL0lPzZOQ51LjCdBKVCsMzJiD0tcaZliUmTaow== X-Received: by 2002:a63:6701:: with SMTP id b1mr2339475pgc.59.1603194250036; Tue, 20 Oct 2020 04:44:10 -0700 (PDT) Received: from localhost.localdomain ([106.215.55.55]) by smtp.gmail.com with ESMTPSA id y22sm2204615pfr.62.2020.10.20.04.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 04:44:09 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, phillip.wood123@gmail.com, congdanhqx@gmail.com, me@ttaylorr.com, Charvi Mendiratta Subject: [PATCH v3 3/5][Outreachy] t7102,t7201: remove whitespace after redirect operator Date: Tue, 20 Oct 2020 17:13:17 +0530 Message-Id: <20201020114319.18245-4-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201020114319.18245-1-charvi077@gmail.com> References: <20201017075455.9660-1-charvi077@gmail.com> <20201020114319.18245-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 | 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 Tue Oct 20 11:43:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charvi Mendiratta X-Patchwork-Id: 11846421 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 02E53C433DF for ; Tue, 20 Oct 2020 11:44:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F0742098B for ; Tue, 20 Oct 2020 11:44:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jwjHtdFJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393735AbgJTLoP (ORCPT ); Tue, 20 Oct 2020 07:44:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393732AbgJTLoP (ORCPT ); Tue, 20 Oct 2020 07:44:15 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75D68C061755 for ; Tue, 20 Oct 2020 04:44:15 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id t4so873990plq.13 for ; Tue, 20 Oct 2020 04:44:15 -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=jwjHtdFJkhV/wdg4eVNawZweHMqSw2uFdsb+Zk/qzQWnd1IGjuYMSOyHrU6aO8SwWo NRCUf0zuiNv4v7owRdZmI8P9tmrih6u4IXiQ/PJNUt32UxVv9tL3lGrdxFuMVb95uabK hZhUjpl0LBUuuYehYQPty11xZ4Nc0LvYUwCWM4GGGarMD/ZHLa8WuHE9QPtj+PfUdI2h jHIGDLwFMBjc6ipBihu34DpMmDX6LLqL/6ve6JRjIlTgLcPzkc66BhhjeIiE/or0H7m7 B/xZ/gpuw+Ks4w2N9AAWxnxd++cE669sU4pgVWo4an21OdjWGVXBE9AqYycQqMR1Tlhv +/eg== 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=nsYKm8J2OFTOTldIrs39TxHZXHSmok78g6YCthRVwLqjaO+nui7+obirlKP59W+ZYl bNHzhb4WRdJhvfN0+Ke8GfpRyRhOsfM1ZLLoA/aVflDYo2dnxIN20lS8xQq/87TDt0IJ O+wC3zFOfZ6IHBNtNxYWbpq7L7NX1F71P4F7GTJtq3HywTeaFTez35QTWEmQ2EDZSxoA OLygfQ8yMXRVs7+8jjw75CJvYpzW6j7Rw+qDlrz9RXOWpAEOwEg6MVT+q8jLbESm9YvC OvhlRMeRp5EwUzyxfMcUAwge9QXWPC34c3j0uJZdQaS1vD4qhYOHhJi+5GOj17TchjR3 FuYA== X-Gm-Message-State: AOAM533upU7oZZp1Z0PeiFg31fAuHL+0lRlaWiF60zQIuqi6ouOo2JM9 GBQI/bCVxboPrrP5JcKqim8Cxq4u4nYm8ZaQ X-Google-Smtp-Source: ABdhPJzw7G3eCcmEaann9bSDSUo/nNifSJ+atLw4hEtXjr8apB2HpD8hZ3kLZfzuWyT8XIOF9u+p3Q== X-Received: by 2002:a17:90b:710:: with SMTP id s16mr2560799pjz.138.1603194254770; Tue, 20 Oct 2020 04:44:14 -0700 (PDT) Received: from localhost.localdomain ([106.215.55.55]) by smtp.gmail.com with ESMTPSA id y22sm2204615pfr.62.2020.10.20.04.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 04:44:14 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, phillip.wood123@gmail.com, congdanhqx@gmail.com, me@ttaylorr.com, Charvi Mendiratta Subject: [PATCH v3 4/5][Outreachy] t7201: use 'git -C' to avoid subshell Date: Tue, 20 Oct 2020 17:13:18 +0530 Message-Id: <20201020114319.18245-5-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201020114319.18245-1-charvi077@gmail.com> References: <20201017075455.9660-1-charvi077@gmail.com> <20201020114319.18245-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 Tue Oct 20 11:43: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: 11846425 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 E42D5C433E7 for ; Tue, 20 Oct 2020 11:44:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 841712098B for ; Tue, 20 Oct 2020 11:44:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uWvalAoG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393738AbgJTLo0 (ORCPT ); Tue, 20 Oct 2020 07:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392939AbgJTLo0 (ORCPT ); Tue, 20 Oct 2020 07:44:26 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D382C061755 for ; Tue, 20 Oct 2020 04:44:26 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id p11so892943pld.5 for ; Tue, 20 Oct 2020 04:44:26 -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=uWvalAoG19n8c6l/R/rHLTsCKmsdG6mMIapV+Bs6hLfh3gCfZfm+ud0GUY+0pAZ1oS e2ZKkBZ7d9GLucCGqK+BML9Zx3TjJwF54u3o2vZEJaB80KkU880fCHs8KTJuMx7Ck01W r+DSIXwQcIi3z0N7b5YGw5/fMoV7tt/SlESqbM+e8JKikeBLj0DPA2I4T81zVBFOgZ0q q9Gsu2Bi3mXShkeVdZB2fRqUi6uIfeC/C8ZjQH+JTc2fOUDxq/02A7SdLA/bqnT3unsg D/NJMIGTKcFrZh7XJW8jo3Ngky6A+uw5k24SRCCyC03i1sz2Qi6MReI8xJ+qMBEWSG2n LkCw== 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=tIbLNO7SAW24KHMtkRKBqUi/zXVA0qxwTGs2M2IJ4A45u90HzSx2x4WknuhmLvLzyN PT+OUqoI0l0knQcmDb5TWzHvGcKDvsFeljn/63cjkTtFXRjeTFwHLTHnXypsvjoN0CaV /DehsiX71OWueBtGyvX2HWnoUV92YpykLdsQH1867u9oWdCeI7CYPtZhXSow+CLhuxe4 NSN7v4n2SEFRecRzGkNa/MO7ejai2C+gqX5swE+SPXdkG6w7XV/HNmn+Y6qrEQXOyZZM +W5v5ir+NBSUPyl3cJ4rrQxqYnwTTKuvkoDx4PupHO8KE0U9Uwe101s2yvhdIyvGMglq qTmg== X-Gm-Message-State: AOAM530hl0NY4Fxq1ZnSvhCbqzcnu6wu/diUJsJI/5Udqkb+sVTa/zTN /MIvkxx/KLyBZaDKwoFhYbiqMypDfSdRPnj0 X-Google-Smtp-Source: ABdhPJx/9a9G1YzdxtIgSZlsDEINVHN3c7cUdi4z4kvKvl7zrdbZmjLTBHS71n+aTzQOBnJjNZigBg== X-Received: by 2002:a17:90a:ba03:: with SMTP id s3mr901197pjr.106.1603194265714; Tue, 20 Oct 2020 04:44:25 -0700 (PDT) Received: from localhost.localdomain ([106.215.55.55]) by smtp.gmail.com with ESMTPSA id y22sm2204615pfr.62.2020.10.20.04.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 04:44:24 -0700 (PDT) From: Charvi Mendiratta To: git@vger.kernel.org Cc: gitster@pobox.com, christian.couder@gmail.com, phillip.wood123@gmail.com, congdanhqx@gmail.com, me@ttaylorr.com, Charvi Mendiratta Subject: [PATCH v3 5/5][Outreachy] t7201: put each command on a seperate line Date: Tue, 20 Oct 2020 17:13:19 +0530 Message-Id: <20201020114319.18245-6-charvi077@gmail.com> X-Mailer: git-send-email 2.29.0.rc1 In-Reply-To: <20201020114319.18245-1-charvi077@gmail.com> References: <20201017075455.9660-1-charvi077@gmail.com> <20201020114319.18245-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) &&