From patchwork Tue Feb 9 17:32:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078647 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 5BD7AC433E6 for ; Tue, 9 Feb 2021 17:33:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AAE864EA6 for ; Tue, 9 Feb 2021 17:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233039AbhBIRdw (ORCPT ); Tue, 9 Feb 2021 12:33:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232937AbhBIRdn (ORCPT ); Tue, 9 Feb 2021 12:33:43 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BC62C06174A for ; Tue, 9 Feb 2021 09:33:03 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id gx20so2083707pjb.1 for ; Tue, 09 Feb 2021 09:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=2lD9hLXj1kZ49O1mX/kkyMcx/jRXpws57cAEAX+y3gw=; b=tRXg6nTpgxWUOeTPx5Uye1DxOFKBTSUDcSnSEr4aSk5ZiIS3sWCGBIME2zMA1rDWe2 Rzlv8nBMRMGxY2N3VFj6dzItxGqD4fQpK8EKVGJG6WF9R8JsQjCv+GaiITG2G1xqEoIP z3K5X33SlVXfYmeJKs6JEFoyCM+RwDkqt6NG2kyhXKuu6UXp2JlKXC3X8BPJHujmPoHY jyb1hK72NpRglntRtgg4JhArAPUmMF5GnznXqpxRfApUCOw8q/Zgo/LBnsRAPlaYAM72 gPerEF1TIu9SSVfxP6UUGcyjDB0F4muFXEiRrFYTUmACvedESbx7dMuNKt6O47LqI0Yd qU+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2lD9hLXj1kZ49O1mX/kkyMcx/jRXpws57cAEAX+y3gw=; b=m8IgY9wpIz+Dt9D833vaWgpiWFCK0T1ki7Y65I2h2lfxtsFowK2qAKULltSfqFwBs9 /f0hQTzXU6ZKNgV+oYfp5Nf157GlcgBSDCJfhTaf5HmI58jqlq8HIcKMB9ggkdEJ/8pN RjmwmBXQY3fx5F4N4u/PulEA46iLXdDnYpDtAlUmCUK8OWZPoYRqqax6LC5MQJczyPiv +guX8UnTxfFOwtjDyfiDTjmHLy3AsfPOhjyNcM/QESsdWAIlXJ4RTbFLgjFhYdKXVG3S Y5qwX1A7R6O02YQMpmDRMDrHkQtKnzZZ5gqbkfj7O9NtOtXkZBVMSJhR0qIGIP0pICJn Qtjg== X-Gm-Message-State: AOAM530booOyVv6tONSSVuMuMbw2HjRbeNo9CqFYU2PHnf4cNCYktMRl 4k/kka1MDqkwyF2GOedJXZZwJ5cXBoV3Vg== X-Google-Smtp-Source: ABdhPJxi/eNIzyitbb4kXSPOilsVatF+cGUDGF8Uo/8T1/A2Uf1Gf2WPkdo68k0aafk1tRHiuKfZHA== X-Received: by 2002:a17:902:52a:b029:da:989f:6c01 with SMTP id 39-20020a170902052ab02900da989f6c01mr21388777plf.45.1612891982625; Tue, 09 Feb 2021 09:33:02 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:01 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 01/10] t7001: modernize test formatting Date: Tue, 9 Feb 2021 23:02:45 +0530 Message-Id: <20210209173254.17712-2-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Some tests in this script are formatted using a very old style: test_expect_success \ 'title' \ 'body line 1 && body line 2' Update the formatting to the modern style: test_expect_success 'title' ' body line 1 && body line 2 ' Signed-off-by: shubham verma --- t/t7001-mv.sh | 192 +++++++++++++++++++++++++------------------------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 63d5f41a12..4bbb51e578 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -3,74 +3,74 @@ test_description='git mv in subdirs' . ./test-lib.sh -test_expect_success \ - 'prepare reference tree' \ - 'mkdir path0 path1 && +test_expect_success 'prepare reference tree' ' + mkdir path0 path1 && cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && git add path0/COPYING && - git commit -m add -a' + git commit -m add -a +' -test_expect_success \ - 'moving the file out of subdirectory' \ - 'cd path0 && git mv COPYING ../path1/COPYING' +test_expect_success 'moving the file out of subdirectory' ' + cd path0 && git mv COPYING ../path1/COPYING +' # in path0 currently -test_expect_success \ - 'commiting the change' \ - 'cd .. && git commit -m move-out -a' +test_expect_success 'commiting the change' ' + cd .. && git commit -m move-out -a +' -test_expect_success \ - 'checking the commit' \ - 'git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path0/COPYING..*path1/COPYING" actual' +test_expect_success 'checking the commit' ' + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path0/COPYING..*path1/COPYING" actual +' -test_expect_success \ - 'moving the file back into subdirectory' \ - 'cd path0 && git mv ../path1/COPYING COPYING' +test_expect_success 'moving the file back into subdirectory' ' + cd path0 && git mv ../path1/COPYING COPYING +' # in path0 currently -test_expect_success \ - 'commiting the change' \ - 'cd .. && git commit -m move-in -a' - -test_expect_success \ - 'checking the commit' \ - 'git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path1/COPYING..*path0/COPYING" actual' - -test_expect_success \ - 'mv --dry-run does not move file' \ - 'git mv -n path0/COPYING MOVED && +test_expect_success 'commiting the change' ' + cd .. && git commit -m move-in -a +' + +test_expect_success 'checking the commit' ' + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path1/COPYING..*path0/COPYING" actual +' + +test_expect_success 'mv --dry-run does not move file' ' + git mv -n path0/COPYING MOVED && test -f path0/COPYING && - test ! -f MOVED' + test ! -f MOVED +' -test_expect_success \ - 'checking -k on non-existing file' \ - 'git mv -k idontexist path0' +test_expect_success 'checking -k on non-existing file' ' + git mv -k idontexist path0 +' -test_expect_success \ - 'checking -k on untracked file' \ - 'touch untracked1 && +test_expect_success 'checking -k on untracked file' ' + touch untracked1 && git mv -k untracked1 path0 && test -f untracked1 && - test ! -f path0/untracked1' + test ! -f path0/untracked1 +' -test_expect_success \ - 'checking -k on multiple untracked files' \ - 'touch untracked2 && +test_expect_success 'checking -k on multiple untracked files' ' + touch untracked2 && git mv -k untracked1 untracked2 path0 && test -f untracked1 && test -f untracked2 && test ! -f path0/untracked1 && - test ! -f path0/untracked2' + test ! -f path0/untracked2 +' -test_expect_success \ - 'checking -f on untracked file with existing target' \ - 'touch path0/untracked1 && +test_expect_success 'checking -f on untracked file with existing target' ' + touch path0/untracked1 && test_must_fail git mv -f untracked1 path0 && test ! -f .git/index.lock && test -f untracked1 && - test -f path0/untracked1' + test -f path0/untracked1 +' # clean up the mess in case bad things happen rm -f idontexist untracked1 untracked2 \ @@ -78,79 +78,79 @@ rm -f idontexist untracked1 untracked2 \ .git/index.lock rmdir path1 -test_expect_success \ - 'moving to absent target with trailing slash' \ - 'test_must_fail git mv path0/COPYING no-such-dir/ && +test_expect_success 'moving to absent target with trailing slash' ' + test_must_fail git mv path0/COPYING no-such-dir/ && test_must_fail git mv path0/COPYING no-such-dir// && git mv path0/ no-such-dir/ && - test_path_is_dir no-such-dir' + test_path_is_dir no-such-dir +' -test_expect_success \ - 'clean up' \ - 'git reset --hard' +test_expect_success 'clean up' ' + git reset --hard +' -test_expect_success \ - 'moving to existing untracked target with trailing slash' \ - 'mkdir path1 && +test_expect_success 'moving to existing untracked target with trailing slash' ' + mkdir path1 && git mv path0/ path1/ && - test_path_is_dir path1/path0/' + test_path_is_dir path1/path0/ +' -test_expect_success \ - 'moving to existing tracked target with trailing slash' \ - 'mkdir path2 && +test_expect_success 'moving to existing tracked target with trailing slash' ' + mkdir path2 && >path2/file && git add path2/file && git mv path1/path0/ path2/ && - test_path_is_dir path2/path0/' + test_path_is_dir path2/path0/ +' -test_expect_success \ - 'clean up' \ - 'git reset --hard' +test_expect_success 'clean up' ' + git reset --hard +' -test_expect_success \ - 'adding another file' \ - 'cp "$TEST_DIRECTORY"/../README.md path0/README && +test_expect_success 'adding another file' ' + cp "$TEST_DIRECTORY"/../README.md path0/README && git add path0/README && - git commit -m add2 -a' + git commit -m add2 -a +' -test_expect_success \ - 'moving whole subdirectory' \ - 'git mv path0 path2' +test_expect_success 'moving whole subdirectory' ' + git mv path0 path2 +' -test_expect_success \ - 'commiting the change' \ - 'git commit -m dir-move -a' +test_expect_success 'commiting the change' ' + git commit -m dir-move -a +' -test_expect_success \ - 'checking the commit' \ - 'git diff-tree -r -M --name-status HEAD^ HEAD >actual && +test_expect_success 'checking the commit' ' + git diff-tree -r -M --name-status HEAD^ HEAD >actual && grep "^R100..*path0/COPYING..*path2/COPYING" actual && - grep "^R100..*path0/README..*path2/README" actual' + grep "^R100..*path0/README..*path2/README" actual +' -test_expect_success \ - 'succeed when source is a prefix of destination' \ - 'git mv path2/COPYING path2/COPYING-renamed' +test_expect_success 'succeed when source is a prefix of destination' ' + git mv path2/COPYING path2/COPYING-renamed +' -test_expect_success \ - 'moving whole subdirectory into subdirectory' \ - 'git mv path2 path1' +test_expect_success 'moving whole subdirectory into subdirectory' ' + git mv path2 path1 +' -test_expect_success \ - 'commiting the change' \ - 'git commit -m dir-move -a' +test_expect_success 'commiting the change' ' + git commit -m dir-move -a +' -test_expect_success \ - 'checking the commit' \ - 'git diff-tree -r -M --name-status HEAD^ HEAD >actual && +test_expect_success 'checking the commit' ' + git diff-tree -r -M --name-status HEAD^ HEAD >actual && grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual && - grep "^R100..*path2/README..*path1/path2/README" actual' + grep "^R100..*path2/README..*path1/path2/README" actual +' -test_expect_success \ - 'do not move directory over existing directory' \ - 'mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0' +test_expect_success 'do not move directory over existing directory' ' + mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0 +' -test_expect_success \ - 'move into "."' \ - 'git mv path1/path2/ .' +test_expect_success 'move into "."' ' + git mv path1/path2/ . +' test_expect_success "Michael Cassar's test case" ' rm -fr .git papers partA && From patchwork Tue Feb 9 17:32:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078649 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 B05B7C433DB for ; Tue, 9 Feb 2021 17:33:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B3A564E9C for ; Tue, 9 Feb 2021 17:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233077AbhBIRdx (ORCPT ); Tue, 9 Feb 2021 12:33:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232953AbhBIRdr (ORCPT ); Tue, 9 Feb 2021 12:33:47 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA6B2C061756 for ; Tue, 9 Feb 2021 09:33:05 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id fa16so1969947pjb.1 for ; Tue, 09 Feb 2021 09:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=TqSEzUV0TZIhWWT2AHFl4GcnRuwudeyumYU5QwgjQos=; b=NBGore3nmWUNyrwy5i5LpoOO64HwzSGOAh/yyN3hEM4WD0SoXD4wBLHkkl3W4weLwp mk+mJiDb61wCHLN5YynQ9cHw48TGr7LU+vYrzz4xtqimlMvOo10IDg7/zHUHyBGI17Yx oSjB+erZLCp3e0RBurNXjQfZW4eCcMRtdO2EoFL+plOVdu7Wz3EoPQgFAJLwn4bzMNCo fTDL+/Moo5g7Bu6GjG5cHS94MC/W5G0/SRcImG3p/3g1WEaiXedhsoPG9L8HeG/gO59n /sGM5NgpHtwgGG0XbryEnKtBgjz50f9vaJjipibVOcm9yag4XJetZrqMvtAeJxe0aBvl fqcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TqSEzUV0TZIhWWT2AHFl4GcnRuwudeyumYU5QwgjQos=; b=XH13NJ4qbv9pGA66dLJfY7IE6aQPTlVSRO85f9ySd4B4/ShIu3xokNr8G2Ezw38hri trY+tsqvKCKk4GflKtNj3IUVMyV/wtMPvamvXD1kUxXXw6pw/UtdwBWz2hWPyP4MSpBb pzFNid0FDLC5sNBaYAwCILspthPB68RGy0UQvCfc8+CMvt3JvGjV/6jy67KRoDFmI4BL KUNe07B9GuvIy/1Ca4o4XBWQ56feK3NmpZPv691kbjQ7FB14C5XTYxDRaaBVuQbqK3P7 f0EKfgeIWkt+Kye+Ug7o9eEHv8nAtawpyAHXL41mQJ10OqdAfOmOrO9aJVFm9V5E5Mr7 OjFg== X-Gm-Message-State: AOAM531DEDLoYk5VAsPW2KdkEVOkbmp7+uNT1NpFZQtsFkGKyrdn8D+J seha/YJ02/5F5gSq2i65op8KBi3k1TGQow== X-Google-Smtp-Source: ABdhPJzYTBpd2+vLM03RFDxLzGecwdesDO41l7Mq9t5NJaW+ArfxDewhc0fO+Dr1hl1REOxUKn1Omw== X-Received: by 2002:a17:902:f1c2:b029:e2:fb7d:7e58 with SMTP id e2-20020a170902f1c2b02900e2fb7d7e58mr2068938plc.54.1612891984955; Tue, 09 Feb 2021 09:33:04 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:04 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 02/10] t7001: indent with TABs instead of spaces Date: Tue, 9 Feb 2021 23:02:46 +0530 Message-Id: <20210209173254.17712-3-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: shubham verma --- t/t7001-mv.sh | 120 +++++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 4bbb51e578..7503233814 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -4,72 +4,72 @@ test_description='git mv in subdirs' . ./test-lib.sh test_expect_success 'prepare reference tree' ' - mkdir path0 path1 && - cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && - git add path0/COPYING && - git commit -m add -a + mkdir path0 path1 && + cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && + git add path0/COPYING && + git commit -m add -a ' test_expect_success 'moving the file out of subdirectory' ' - cd path0 && git mv COPYING ../path1/COPYING + cd path0 && git mv COPYING ../path1/COPYING ' # in path0 currently test_expect_success 'commiting the change' ' - cd .. && git commit -m move-out -a + cd .. && git commit -m move-out -a ' test_expect_success 'checking the commit' ' - git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path0/COPYING..*path1/COPYING" actual + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path0/COPYING..*path1/COPYING" actual ' test_expect_success 'moving the file back into subdirectory' ' - cd path0 && git mv ../path1/COPYING COPYING + cd path0 && git mv ../path1/COPYING COPYING ' # in path0 currently test_expect_success 'commiting the change' ' - cd .. && git commit -m move-in -a + cd .. && git commit -m move-in -a ' test_expect_success 'checking the commit' ' - git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path1/COPYING..*path0/COPYING" actual + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path1/COPYING..*path0/COPYING" actual ' test_expect_success 'mv --dry-run does not move file' ' - git mv -n path0/COPYING MOVED && - test -f path0/COPYING && - test ! -f MOVED + git mv -n path0/COPYING MOVED && + test -f path0/COPYING && + test ! -f MOVED ' test_expect_success 'checking -k on non-existing file' ' - git mv -k idontexist path0 + git mv -k idontexist path0 ' test_expect_success 'checking -k on untracked file' ' - touch untracked1 && - git mv -k untracked1 path0 && - test -f untracked1 && - test ! -f path0/untracked1 + touch untracked1 && + git mv -k untracked1 path0 && + test -f untracked1 && + test ! -f path0/untracked1 ' test_expect_success 'checking -k on multiple untracked files' ' - touch untracked2 && - git mv -k untracked1 untracked2 path0 && - test -f untracked1 && - test -f untracked2 && - test ! -f path0/untracked1 && - test ! -f path0/untracked2 + touch untracked2 && + git mv -k untracked1 untracked2 path0 && + test -f untracked1 && + test -f untracked2 && + test ! -f path0/untracked1 && + test ! -f path0/untracked2 ' test_expect_success 'checking -f on untracked file with existing target' ' - touch path0/untracked1 && - test_must_fail git mv -f untracked1 path0 && - test ! -f .git/index.lock && - test -f untracked1 && - test -f path0/untracked1 + touch path0/untracked1 && + test_must_fail git mv -f untracked1 path0 && + test ! -f .git/index.lock && + test -f untracked1 && + test -f path0/untracked1 ' # clean up the mess in case bad things happen @@ -79,77 +79,77 @@ rm -f idontexist untracked1 untracked2 \ rmdir path1 test_expect_success 'moving to absent target with trailing slash' ' - test_must_fail git mv path0/COPYING no-such-dir/ && - test_must_fail git mv path0/COPYING no-such-dir// && - git mv path0/ no-such-dir/ && - test_path_is_dir no-such-dir + test_must_fail git mv path0/COPYING no-such-dir/ && + test_must_fail git mv path0/COPYING no-such-dir// && + git mv path0/ no-such-dir/ && + test_path_is_dir no-such-dir ' test_expect_success 'clean up' ' - git reset --hard + git reset --hard ' test_expect_success 'moving to existing untracked target with trailing slash' ' - mkdir path1 && - git mv path0/ path1/ && - test_path_is_dir path1/path0/ + mkdir path1 && + git mv path0/ path1/ && + test_path_is_dir path1/path0/ ' test_expect_success 'moving to existing tracked target with trailing slash' ' - mkdir path2 && - >path2/file && git add path2/file && - git mv path1/path0/ path2/ && - test_path_is_dir path2/path0/ + mkdir path2 && + >path2/file && git add path2/file && + git mv path1/path0/ path2/ && + test_path_is_dir path2/path0/ ' test_expect_success 'clean up' ' - git reset --hard + git reset --hard ' test_expect_success 'adding another file' ' - cp "$TEST_DIRECTORY"/../README.md path0/README && - git add path0/README && - git commit -m add2 -a + cp "$TEST_DIRECTORY"/../README.md path0/README && + git add path0/README && + git commit -m add2 -a ' test_expect_success 'moving whole subdirectory' ' - git mv path0 path2 + git mv path0 path2 ' test_expect_success 'commiting the change' ' - git commit -m dir-move -a + git commit -m dir-move -a ' test_expect_success 'checking the commit' ' - git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path0/COPYING..*path2/COPYING" actual && - grep "^R100..*path0/README..*path2/README" actual + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path0/COPYING..*path2/COPYING" actual && + grep "^R100..*path0/README..*path2/README" actual ' test_expect_success 'succeed when source is a prefix of destination' ' - git mv path2/COPYING path2/COPYING-renamed + git mv path2/COPYING path2/COPYING-renamed ' test_expect_success 'moving whole subdirectory into subdirectory' ' - git mv path2 path1 + git mv path2 path1 ' test_expect_success 'commiting the change' ' - git commit -m dir-move -a + git commit -m dir-move -a ' test_expect_success 'checking the commit' ' - git diff-tree -r -M --name-status HEAD^ HEAD >actual && - grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual && - grep "^R100..*path2/README..*path1/path2/README" actual + git diff-tree -r -M --name-status HEAD^ HEAD >actual && + grep "^R100..*path2/COPYING..*path1/path2/COPYING" actual && + grep "^R100..*path2/README..*path1/path2/README" actual ' test_expect_success 'do not move directory over existing directory' ' - mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0 + mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0 ' test_expect_success 'move into "."' ' - git mv path1/path2/ . + git mv path1/path2/ . ' test_expect_success "Michael Cassar's test case" ' From patchwork Tue Feb 9 17:32:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078651 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 065CFC433E6 for ; Tue, 9 Feb 2021 17:33:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C188464E9C for ; Tue, 9 Feb 2021 17:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233103AbhBIRdz (ORCPT ); Tue, 9 Feb 2021 12:33:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232974AbhBIRds (ORCPT ); Tue, 9 Feb 2021 12:33:48 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A305C0613D6 for ; Tue, 9 Feb 2021 09:33:08 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id z21so12923407pgj.4 for ; Tue, 09 Feb 2021 09:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=BSnbbSUu+63F9e8TJQ78/CnLDEF9hGiUb4HH1gTdE3o=; b=ir04arsSN5VRGQwaQvUv4AGAxjrvf2+vT+Y1EmWqwm0NXTC80wpMsKaqxY13gEXcy3 sHIDFThcPLUdyAcLHQPVgH0/SO7H9n1M88BUnHL54jOX5gU3T8ouk7zasGONWg9+5ubd GntlKjYkLuhx5K/gVBiQPEI8rE3VzUTDffPKMSS17j5rJ1SlMPXhRMhGj9RpKTCmQVvK E68jCc8yB/R7mk3r7wLGqdmSvRwa6tRnu7NaLH/hIES5zr5Yy0uA6+0x/KC9X0sgZ5Mu wWA4J8xc+FKO6QarpzsPAqf7A30SaUW4NjArL2NPfvvwad7TrQ+KKOTzxi2OZGa+6Gmr H7DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BSnbbSUu+63F9e8TJQ78/CnLDEF9hGiUb4HH1gTdE3o=; b=GwI0K88H/ZSC2RfyDxfJnmh1N677Pb03xqyZ9kzjYojbtTCikjdV5m/LfPtXvsbMTv wjgalky3TgxL6TS/sKFg6J+2kRouwjYWsgQQoVBticmQ5511nbj9WWigX1Vgm2I3akUg KVfE+2xctBFWso5cM/8sEGVq4DAp4iN+9KjNnxokwutBfEObe81F5AdOU3e6i2+g/pcu uIRo5mDs9N4u+nNpAqc1/t1eD/igLQpHqqaNpK8ngqg0UoLXWL7bsh65oucUTzUVGcfM DPFwI49SB0THsyYJbpIX4uBaZa58ywCBVoWSfVq/Ijwwwuo7u+r8NV+QyquR/XXyDrTd GTTw== X-Gm-Message-State: AOAM530TjWDlBaTQeCuyyk5wjeulaY1m8zQdbh1PjfNrAbiZAUHMCyNj ifH6XBUoZV5IiYtZcXf19uoDzxX0gZ2E4w== X-Google-Smtp-Source: ABdhPJwkEeX6Xl6cs/wQzynyKZfg51/7tg/PJyfRrq2VYMqSs1bDyBr5rFHKMmMOnZRM6VCsujqjOQ== X-Received: by 2002:a63:4405:: with SMTP id r5mr22515887pga.168.1612891987334; Tue, 09 Feb 2021 09:33:07 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:06 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 03/10] t7001: remove unnecessary blank lines Date: Tue, 9 Feb 2021 23:02:47 +0530 Message-Id: <20210209173254.17712-4-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@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: shubham verma --- t/t7001-mv.sh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 7503233814..f63802442b 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -182,7 +182,6 @@ test_expect_success "Sergey Vlasov's test case" ' ' test_expect_success 'absolute pathname' '( - rm -fr mine && mkdir mine && cd mine && @@ -196,12 +195,9 @@ test_expect_success 'absolute pathname' '( ! test -d sub && test -d in && git ls-files --error-unmatch in/file - - )' test_expect_success 'absolute pathname outside should fail' '( - rm -fr mine && mkdir mine && cd mine && @@ -216,7 +212,6 @@ test_expect_success 'absolute pathname outside should fail' '( test -d sub && ! test -d ../in && git ls-files --error-unmatch sub/file - )' test_expect_success 'git mv to move multiple sources into a directory' ' @@ -232,7 +227,6 @@ test_expect_success 'git mv to move multiple sources into a directory' ' ' test_expect_success 'git mv should not change sha1 of moved cache entry' ' - rm -fr .git && git init && echo 1 >dirty && @@ -243,7 +237,6 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' ' echo 2 >dirty2 && git mv dirty2 dirty && [ "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ] - ' rm -f dirty dirty2 @@ -266,7 +259,6 @@ test_expect_success 'git mv error on conflicted file' ' ' test_expect_success 'git mv should overwrite symlink to a file' ' - rm -fr .git && git init && echo 1 >moved && @@ -279,13 +271,11 @@ test_expect_success 'git mv should overwrite symlink to a file' ' test "$(cat symlink)" = 1 && git update-index --refresh && git diff-files --quiet - ' rm -f moved symlink test_expect_success 'git mv should overwrite file with a symlink' ' - rm -fr .git && git init && echo 1 >moved && @@ -296,11 +286,9 @@ test_expect_success 'git mv should overwrite file with a symlink' ' ! test -e symlink && git update-index --refresh && git diff-files --quiet - ' test_expect_success SYMLINKS 'check moved symlink' ' - test -h moved ' From patchwork Tue Feb 9 17:32:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078653 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 D0FFFC433DB for ; Tue, 9 Feb 2021 17:34:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B37E64E7E for ; Tue, 9 Feb 2021 17:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233137AbhBIRd5 (ORCPT ); Tue, 9 Feb 2021 12:33:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233014AbhBIRdv (ORCPT ); Tue, 9 Feb 2021 12:33:51 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B00FBC061786 for ; Tue, 9 Feb 2021 09:33:10 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id z7so228188plk.7 for ; Tue, 09 Feb 2021 09:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=k0orSRUqVuqAAjknd8gNpZ+OTr37Fkr/H3F2+BOctpo=; b=LOj7j//Zmip3oc3+vPtP2nuyaw7jKUCNBs9aE4zp4x5YvlGe5UCZx8r4kB10Z6FAFg WTMVmaJKfydz1jzxwgyrZZWZoOKx5o2gN7J1MDPQMrTRcFbp68SMldFwUmAv5ipr/u7V BgNo3F0akYGVwQYaC5nXi0FOmBCJJYi1vS294d4lQ1EENF7+jITcPbNtRsCzR1WLeTG1 EJ9cCf4QNUF3PtRXGLh9uULk0RBUh/61Y5XDuPa1ALy2lQdITOs/eebWD8dgWgFSnhp8 VH+FhMWlYqDWDgKU2RCbLwRroa+i5wk9UExow/RS6RgTCLIIR+YXM+U4BHL3vb++/vUk kHAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k0orSRUqVuqAAjknd8gNpZ+OTr37Fkr/H3F2+BOctpo=; b=dAlLe9M5GhseZnAqWA4CcmuulBM8PmMCeQS/SUGOh7f90Dd29iWGIqhaeLExf7BfWl K8rb8xlCaspUuaB0pVtm0Z5/SRaaBJ7PKuga4TrnvIvh2C5mypoQftJRxhzy7KIjEsyK CWd9ea+TBG1xMFUilrjjTh3LAHaiPblFTBQ/X/KISe7L2ZQkW1y558llg3cWi4UvZ2oU l6j8mbU6tZnCBDEWqg3cHUVKU7jx14g4QDGQN0DsMy9G9YeB5Elos2l0jbvy2yG3/gXp XezIP4PTfnJy2pjCjYqw6mdknoktuvbl0qv7weGNXu6QujlssPxp9TeKaRQpfQdhh67v SW+g== X-Gm-Message-State: AOAM533a9vsT1tlA+MlEI+hQsMYYWak2CVhcaicn4fyfJYfmV6/udS8j 6f9xhhWVdSBcmJ11ar/t3svaC8YGbSLr0Q== X-Google-Smtp-Source: ABdhPJygFbFgx5UcZGyPCUvIoh0m+mwRTZJgIaBmlEI40i2m47/Uh7SwWM7cL+FRa9KMnC3MeQ48vg== X-Received: by 2002:a17:902:a9ca:b029:e1:b3e:406c with SMTP id b10-20020a170902a9cab02900e10b3e406cmr22143547plr.84.1612891989900; Tue, 09 Feb 2021 09:33:09 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:09 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 04/10] t7001: modernize subshell formatting Date: Tue, 9 Feb 2021 23:02:48 +0530 Message-Id: <20210209173254.17712-5-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Some test use an old style for formatting subshells: (command && ... Update them to the modern style: ( command && ... Signed-off-by: shubham verma --- t/t7001-mv.sh | 74 ++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index f63802442b..a4a14a3b2e 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -181,38 +181,42 @@ test_expect_success "Sergey Vlasov's test case" ' git mv ab a ' -test_expect_success 'absolute pathname' '( - rm -fr mine && - mkdir mine && - cd mine && - test_create_repo one && - cd one && - mkdir sub && - >sub/file && - git add sub/file && - - git mv sub "$(pwd)/in" && - ! test -d sub && - test -d in && - git ls-files --error-unmatch in/file -)' - -test_expect_success 'absolute pathname outside should fail' '( - rm -fr mine && - mkdir mine && - cd mine && - out=$(pwd) && - test_create_repo one && - cd one && - mkdir sub && - >sub/file && - git add sub/file && - - test_must_fail git mv sub "$out/out" && - test -d sub && - ! test -d ../in && - git ls-files --error-unmatch sub/file -)' +test_expect_success 'absolute pathname' ' + ( + rm -fr mine && + mkdir mine && + cd mine && + test_create_repo one && + cd one && + mkdir sub && + >sub/file && + git add sub/file && + + git mv sub "$(pwd)/in" && + ! test -d sub && + test -d in && + git ls-files --error-unmatch in/file + ) +' + +test_expect_success 'absolute pathname outside should fail' ' + ( + rm -fr mine && + mkdir mine && + cd mine && + out=$(pwd) && + test_create_repo one && + cd one && + mkdir sub && + >sub/file && + git add sub/file && + + test_must_fail git mv sub "$out/out" && + test -d sub && + ! test -d ../in && + git ls-files --error-unmatch sub/file + ) +' test_expect_success 'git mv to move multiple sources into a directory' ' rm -fr .git && git init && @@ -503,14 +507,16 @@ test_expect_success 'moving a submodule in nested directories' ' test_expect_success 'moving nested submodules' ' git commit -am "cleanup commit" && mkdir sub_nested_nested && - (cd sub_nested_nested && + ( + cd sub_nested_nested && touch nested_level2 && git init && git add . && git commit -m "nested level 2" ) && mkdir sub_nested && - (cd sub_nested && + ( + cd sub_nested && touch nested_level1 && git init && git add . && From patchwork Tue Feb 9 17:32:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078659 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 9B625C433DB for ; Tue, 9 Feb 2021 17:35:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 675E564E15 for ; Tue, 9 Feb 2021 17:35:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233215AbhBIRf3 (ORCPT ); Tue, 9 Feb 2021 12:35:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233035AbhBIReb (ORCPT ); Tue, 9 Feb 2021 12:34:31 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FE9DC061788 for ; Tue, 9 Feb 2021 09:33:13 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id e9so10141820plh.3 for ; Tue, 09 Feb 2021 09:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=xEhyEIlYwlK26W71yk2CEwFm0W2E5wUKebCHmRDaATg=; b=R903VfZeY15ipjahcEmIgut6S7hNcu/9ctdbsxVmpoJnLI5EoOSCYnDbMIwuYLtVJ5 dIti8IsKDEpV10zlLbLAH/yY/eHnnNBaJH1WjFxHeI6WBoRKnM9kOvknttQYea1TeTYz JzA3dvOUPEHPqjDzxMCh0FL8nUujGA0BlFc/LwyydnSVC4Tt1+hP2h5smz9UfepJ395X NrlLQ6rohzHBJviFE+wH9KvUToKfIkZBoB0rO++kN+QDLaX9q7NEz7Qx8wmDOYNkCXV0 +NLARZRhUN31yXqH/wANjalofUhBNMUkx9irw737LdzdSm/hfF4Kx+kiqefCYiB9IEBq 1msg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xEhyEIlYwlK26W71yk2CEwFm0W2E5wUKebCHmRDaATg=; b=bxcPMw/uPQijAyxA2JOV+2rlY/eJ52ydDd6PcuEKQo+lLb4laQ+bYYbyQtWy3d51N+ LuPtQdx9CVlXpwwwmkdDl0Rh5E+dKZ9slKvPwej7luj08KIC/t6df70WocEtv59/wvew aC6YUfJlExpHTQwjbjwXrUbQHht3umNR97+N9mL6W+zt9xShEh6yhNjkqTwU0i+njRRl Z2e9hEPOBfIriLh9+G8VB9KelF1XMBX5IIRj6/UdyPYb1xC8Pa53txYiu2pQFOxLmwfm UecCMSYZ00Q/R4IGb/50G+1gR0x8vFGR0snODcUsxZuQvic4VQXrkh/OdSmQ+hAs3sbh Bj7g== X-Gm-Message-State: AOAM533Fd8gdF6lOr2bOTjuk1+rnFwpbw17tsMCyxVmIu6Ai4QPgxyah RMgfG5O54waxO8XEMSiDrm02sI9vySsaFA== X-Google-Smtp-Source: ABdhPJwMtEpFbcqP57VcN+VPMnayA9PSkBIyEzS3+TS8g7EMYJcMJr2SjbJ7I7Xvh/7A1lcoLCxGuA== X-Received: by 2002:a17:902:e886:b029:de:57b2:da69 with SMTP id w6-20020a170902e886b02900de57b2da69mr22208095plg.65.1612891992256; Tue, 09 Feb 2021 09:33:12 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:11 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 05/10] t7001: remove whitespace after redirect operators Date: Tue, 9 Feb 2021 23:02:49 +0530 Message-Id: <20210209173254.17712-6-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@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: shubham verma --- t/t7001-mv.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index a4a14a3b2e..02fbc90dea 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -156,9 +156,9 @@ test_expect_success "Michael Cassar's test case" ' rm -fr .git papers partA && git init && mkdir -p papers/unsorted papers/all-papers partA && - echo a > papers/unsorted/Thesis.pdf && - echo b > partA/outline.txt && - echo c > papers/unsorted/_another && + echo a >papers/unsorted/Thesis.pdf && + echo b >partA/outline.txt && + echo c >papers/unsorted/_another && git add papers partA && T1=$(git write-tree) && From patchwork Tue Feb 9 17:32:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078661 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 DA50EC433E0 for ; Tue, 9 Feb 2021 17:35:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9894E64EA6 for ; Tue, 9 Feb 2021 17:35:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233226AbhBIRfk (ORCPT ); Tue, 9 Feb 2021 12:35:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233142AbhBIReb (ORCPT ); Tue, 9 Feb 2021 12:34:31 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6C3EC06178B for ; Tue, 9 Feb 2021 09:33:15 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id k22so5759548pll.6 for ; Tue, 09 Feb 2021 09:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=kMTSMccCEqbDu4PyMUsL69kEc2V3WsXSmJCj8lXCwU0=; b=YDbDKNjKXjuZUoUve45N+pQgA6fZZ//QMbxCvdBqdJzChieh91pmGC9Q+1p8S2fyzk XuumMDMZsnfNf951JTwR6lY12r8Fg5h/BWHl3r+NoWIKIpoUYBPzrcQF8tKVWv7Vv4kO Ip9+rgXn9uOdaVJTcRWpzvg9aEh387+B6iIYHTCk9S37LZVXgj1MZdbXKV6qWcS/rM0q O7+OXdC8jNHurXcnB3/AtXdqkH5UPksWsDQ6rI19UsdQh1GUAH2tEYkaPO2UKc490M7f HUfR5NZMtdg+yNebF9Zjpu6XBpbQwy71UgHuU4+vAugv9m4yMX/6YHv9zv4eKNlsz4I1 XAyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kMTSMccCEqbDu4PyMUsL69kEc2V3WsXSmJCj8lXCwU0=; b=brRtmTnrI+VyUuZxe4ZNXdyQC9nSU+U+w0hF6deuliylAt0whauBElLGXbWERPFZON PAElXHxLkfUTzA5PKr4ZliKm6+hi3l5CdAm3xhYyUqaOpt8Yk3M22h7qXvZz13CAUsj2 7lNpu8hV6sYWDkVVyej/U4GBl6bse4VtPdo26loDsx5MHiY2CO41pLufj1BGuH2qYttd dfjJiMKbOZg6/1k8M4VAwA/tb6n3HqCpwdCVKcOdFuOlJ7HEM/M1DP/5zsxSOmEhDvsb 8s4Zz1wxndO673mazELnmW9jh43H/buhJP2JWlmR1KDx3pvFXQwnA3bj1UZ6C8moQeLG XCiQ== X-Gm-Message-State: AOAM530CxvuRbty+O8BoS/I1TZBeokOAZL+9P2IZ6WL0Ed6+1aMzt5s+ S7O/2dbBBsAx4af0vFGrYQdmjIt2GpNU3g== X-Google-Smtp-Source: ABdhPJwMOBH+LeIq1kuOC2o3iG8UHQZ+927WmDxX5pVDMIiep742aXjcCaQZehGaFj3EEUXbIt/H5Q== X-Received: by 2002:a17:902:7201:b029:e0:ee2:dae6 with SMTP id ba1-20020a1709027201b02900e00ee2dae6mr21482463plb.25.1612891994839; Tue, 09 Feb 2021 09:33:14 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:14 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 06/10] t7001: avoid using `cd` outside of subshells Date: Tue, 9 Feb 2021 23:02:50 +0530 Message-Id: <20210209173254.17712-7-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@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. While at it, make some other tests more concise by replacing simple subshells with `git -C`. Signed-off-by: shubham verma --- t/t7001-mv.sh | 45 +++++++++++---------------------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 02fbc90dea..81897a3095 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -11,12 +11,11 @@ test_expect_success 'prepare reference tree' ' ' test_expect_success 'moving the file out of subdirectory' ' - cd path0 && git mv COPYING ../path1/COPYING + git -C path0 mv COPYING ../path1/COPYING ' -# in path0 currently test_expect_success 'commiting the change' ' - cd .. && git commit -m move-out -a + git commit -m move-out -a ' test_expect_success 'checking the commit' ' @@ -25,12 +24,11 @@ test_expect_success 'checking the commit' ' ' test_expect_success 'moving the file back into subdirectory' ' - cd path0 && git mv ../path1/COPYING COPYING + git -C path0 mv ../path1/COPYING COPYING ' -# in path0 currently test_expect_success 'commiting the change' ' - cd .. && git commit -m move-in -a + git commit -m move-in -a ' test_expect_success 'checking the commit' ' @@ -328,10 +326,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm git mv sub mod/sub && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && git update-index --refresh && git diff-files --quiet ' @@ -351,10 +346,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu git mv sub mod/sub && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && echo mod/sub >expected && git config -f .gitmodules submodule.sub.path >actual && test_cmp expected actual && @@ -368,16 +360,10 @@ test_expect_success 'git mv moves a submodule with gitfile' ' git submodule update && entry="$(git ls-files --stage sub | cut -f 1)" && mkdir mod && - ( - cd mod && - git mv ../sub/ . - ) && + git -C mod mv ../sub/ . && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && echo mod/sub >expected && git config -f .gitmodules submodule.sub.path >actual && test_cmp expected actual && @@ -396,10 +382,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' ' test_must_be_empty actual.err && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && git update-index --refresh && git diff-files --quiet ' @@ -420,10 +403,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta test_must_be_empty actual.err && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && git update-index --refresh && git diff-files --quiet ' @@ -441,10 +421,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule test_i18ncmp expect.err actual.err && ! test -e sub && [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && - ( - cd mod/sub && - git status - ) && + git -C mod/sub status && git update-index --refresh && git diff-files --quiet ' From patchwork Tue Feb 9 17:32:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078657 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 427E0C433DB for ; Tue, 9 Feb 2021 17:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 112E364E15 for ; Tue, 9 Feb 2021 17:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233042AbhBIRfZ (ORCPT ); Tue, 9 Feb 2021 12:35:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233149AbhBIReb (ORCPT ); Tue, 9 Feb 2021 12:34:31 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87F9DC06178C for ; Tue, 9 Feb 2021 09:33:18 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id z7so228382plk.7 for ; Tue, 09 Feb 2021 09:33:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Gfk4ClQpcJm886xeJ5dk14ZHlKvVFDE4MmC50jAdgA0=; b=hFmMHTrqzHj/WVdPjgRSyewH9ZYTfce5Tbgm87muVR+iqkz5ww8kXMHTlfS3CP9huY 9UXQj1BQ6DJ6p78We5VM1tExPuIOWifVk6CRdzJtm8j5yWU62cdcsYFJ4KiTGN0pteY3 cHsf7EsM2dCNUlv2l+9LkRyyNPPCVZ6X2crliHpX2pw8s8gCF/FnofUXUFO9+JPOrFyI v6pALgyssmg069KuiJ72J8903I7YjPQ/sTMprW8m4xBR6HdRD87XsZ2RrxQXZBfFptgU GqOzoyVMB4CtKFYrklnBXQkOUh6Ch9z6Qkk6jcgnL2uOl15fDM0eG8tTkB9KwwCYwsuL SCmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Gfk4ClQpcJm886xeJ5dk14ZHlKvVFDE4MmC50jAdgA0=; b=uC3Krs5but4lqb4Kn3HvsplTXobYSLFeBcRmzgfy9CYszpOl5KEuSnmPzsQZVVzhv0 +DDexv8QnFURuszBXkM6MdSIzPfi9+qXaJZ315z3QbZxcHLOvJyP4Cly2tJZtilMHxGy hxOGN18FZtLv4ZAE7dDAuHWAz/jXm9jPJ/AfqMcVtfKeR+pe3ewaTzrAx/gVpMnWF1Gq /HFdddJL5kHuJpncKKmCnvf5fdDvkW2zy2Dnxq3JEH+9jJCgbb/CuwqgtUwBfN2lW+pc jWu8ne12/IFK+PThmmhcl/c+o8mXceiaQL2M+75Y6mzL8BXjZax9uWUNqflBbJsc47e4 si+w== X-Gm-Message-State: AOAM532LpKQP/a2pKvtHi1F4PQsbW4hbZx4Y8Ce+hggs7OsDXBM847Hp Cr5PoruUc0XNojVbBG2eO5yvNutmeGQ+7g== X-Google-Smtp-Source: ABdhPJyjNFbacrTFmY/fCwsFafweCVWEkt7HPbJG3TCfL8w4GQdd5gOWeY3D9hIAoZsJI+J7jzAHQg== X-Received: by 2002:a17:902:f688:b029:da:a817:1753 with SMTP id l8-20020a170902f688b02900daa8171753mr21877130plg.76.1612891997159; Tue, 09 Feb 2021 09:33:17 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:16 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 07/10] t7001: use '>' rather than 'touch' Date: Tue, 9 Feb 2021 23:02:51 +0530 Message-Id: <20210209173254.17712-8-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use `>` rather than `touch` to create an empty file when the timestamp isn't relevant to the test. Signed-off-by: shubham verma --- t/t7001-mv.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 81897a3095..1671241fc8 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -47,14 +47,14 @@ test_expect_success 'checking -k on non-existing file' ' ' test_expect_success 'checking -k on untracked file' ' - touch untracked1 && + >untracked1 && git mv -k untracked1 path0 && test -f untracked1 && test ! -f path0/untracked1 ' test_expect_success 'checking -k on multiple untracked files' ' - touch untracked2 && + >untracked2 && git mv -k untracked1 untracked2 path0 && test -f untracked1 && test -f untracked2 && @@ -63,7 +63,7 @@ test_expect_success 'checking -k on multiple untracked files' ' ' test_expect_success 'checking -f on untracked file with existing target' ' - touch path0/untracked1 && + >path0/untracked1 && test_must_fail git mv -f untracked1 path0 && test ! -f .git/index.lock && test -f untracked1 && @@ -486,7 +486,7 @@ test_expect_success 'moving nested submodules' ' mkdir sub_nested_nested && ( cd sub_nested_nested && - touch nested_level2 && + >nested_level2 && git init && git add . && git commit -m "nested level 2" @@ -494,7 +494,7 @@ test_expect_success 'moving nested submodules' ' mkdir sub_nested && ( cd sub_nested && - touch nested_level1 && + >nested_level1 && git init && git add . && git commit -m "nested level 1" && From patchwork Tue Feb 9 17:32:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078663 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 60495C433E0 for ; Tue, 9 Feb 2021 17:35:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B94C64EA6 for ; Tue, 9 Feb 2021 17:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233234AbhBIRfo (ORCPT ); Tue, 9 Feb 2021 12:35:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbhBIReb (ORCPT ); Tue, 9 Feb 2021 12:34:31 -0500 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF91C061793 for ; Tue, 9 Feb 2021 09:33:20 -0800 (PST) Received: by mail-pf1-x42b.google.com with SMTP id j12so12317468pfj.12 for ; Tue, 09 Feb 2021 09:33:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Za395WSwiabtFFeu22KUW7sCRPfd356ZKXC8plECEGA=; b=r86MfST5BKE5vhjLJ/MKm+l3p3a0DE0pQnXTe1NuqIuIz5MkGz7YWoMvkrE0y7GFsU Gic6bGvTRg0qM1nKkz7+DLyusC0tB0g5Fn9jvMx5rPPPWc4wyC2Z9i5LsvmvGVxtw9UR ovicZ01W86d7txj95smsQkOfgvohj/idL3mwJHJ9dFdbA3wgOx6Ge1wAemjJooMVh+Br sh/TYrp3G+eMqMEzaV2YCeKV3cUHtkmijDV0ku1owKb1wGuAYKEy+fE1hJK18yWxT74z 7TwzDFLQY6rsyv222xwCEL6NEMQfSvVsGj/rZ+VD3wSDZ4T1REGIcTNP57GKK2KGgWvT YJ9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Za395WSwiabtFFeu22KUW7sCRPfd356ZKXC8plECEGA=; b=BtMbz95YlRGXJEENNLooigMZx1A48yXsBpPXQ08WDDvW+t/2exfpbRpq7recwsNHxd F6ZlrovCDW3mGBsPpWFp6h2y9dUs2lOhe6bpXLA/vhLGsXun5ffNmVFybJ6gtaK9yt3V Uc6pV9+PQkl5U/k8U/29wDB1NyDM9G+1DhafnQBNKe7sIJlQOkLkpeYhyq7VAMLfStCb b12ITSsYPS15H1y2Za/UhE47Jphat3UYvJnNXWZ4pzpcZcjb/MrM2165xZNwDU4pXUAs LkPGfYNXaOnY4u8GIxjD2P7Pi693Bd/477xhJQxuDWSXWt/xxmsNs/aS28hAIqalk4NB YBoQ== X-Gm-Message-State: AOAM533WENbMSuLM/apkcg68DzZgQm8GuAtd0gm0kmswZnA23MzhLts9 YHXWomIPhvjPl37q8edtHDjJ/bu8ob9SAg== X-Google-Smtp-Source: ABdhPJyaiH7M6V38TOcB9Q9trDWZ6mvLy4L2SlrQoxBaH4mSgeIiOYACLkWc8e9gWLBhqGUHvPSyew== X-Received: by 2002:a62:1896:0:b029:197:491c:be38 with SMTP id 144-20020a6218960000b0290197491cbe38mr23426467pfy.15.1612891999687; Tue, 09 Feb 2021 09:33:19 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:19 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 08/10] t7001: put each command on a separate line Date: Tue, 9 Feb 2021 23:02:52 +0530 Message-Id: <20210209173254.17712-9-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@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: shubham verma --- t/t7001-mv.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 1671241fc8..9a73232c7c 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -143,7 +143,9 @@ test_expect_success 'checking the commit' ' ' test_expect_success 'do not move directory over existing directory' ' - mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0 + mkdir path0 && + mkdir path0/path2 && + test_must_fail git mv path2 path0 ' test_expect_success 'move into "."' ' From patchwork Tue Feb 9 17:32:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078655 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 3901AC433E0 for ; Tue, 9 Feb 2021 17:35:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED41E64E9C for ; Tue, 9 Feb 2021 17:35:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233197AbhBIRfO (ORCPT ); Tue, 9 Feb 2021 12:35:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233157AbhBIReb (ORCPT ); Tue, 9 Feb 2021 12:34:31 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4C14C061794 for ; Tue, 9 Feb 2021 09:33:22 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id cl8so1970897pjb.0 for ; Tue, 09 Feb 2021 09:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=F8vdh7XjqgjUgLdZmx1mpnnQVoOPhzxzXWk4x8TiI30=; b=Q1vE7LEHx+PiCYMM7LuLHzOBktheNs/l3BDxL1EXTTtKfTaxCvsXG0/PGX6xdOTtNk sJxuSHcPqJMCRJnfeWcKFUzet1uduO8FlWDZ9R7TxACQzLqIaFruzGOs9LGCN20PhSxZ tNQ3jlTzgJzx0J1S0u6qLY/YkvME24JaH0BsIXxouugE6jwxI7R1DLUMoOM8PF1+3+wp jGOHgqNICRRRS32Y9SwKuYLLR7IX6DEG3mTLgdRFGoAUsiayPKG7GMTKN1+dl0Xrfxco nUfnS2qg5oQMFYpYArTB9hOKKBcxDcnNc4Vuu7in33s98kR7v7JcQA+0uhW/ZEQ215zY zD3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F8vdh7XjqgjUgLdZmx1mpnnQVoOPhzxzXWk4x8TiI30=; b=oGS+AJY1KsUPjAriEfzpxuzZZGDH3JN/IyRxygby3Xn3DwhG0SrFq7QRrYl1ip4yzK 1DjpKZFmuMTu8zjqn5OJ4ZuPSWTosMeKGfkrwmAEri5INaIh73CzHhbzW+EXjGckkIeF LQKj6EaqaPNuKRswG1Y4sid437q6K24WJf/s1cuKS92lkN192A//2Fu1v8kTsfIX5A0n zw9x3UTDh0j/wn3rFSGnoEAyZPlBHbf71s6GG2fJJR52P5PQlSX3QTvGsw22khR28vxP W+istw91SHGXy8Zin84RvZh5dxSnaRTfdeNfThDv2sRwp1xtUaDcfoZvAEKzvf3rbtks zOBw== X-Gm-Message-State: AOAM531cYMLM1ZuVy5yohv/HSKtBqUBk8xXpLKnyfs0s4fzG47ukolCw medxh2UCeUgD3lycoGhXNS+vDr5CiH91uA== X-Google-Smtp-Source: ABdhPJwNnmuBAdQghobvwbJ1eXxX4GOdrYvXVkNh+TXg3EjnnYgvevp37Jt3gzHMPyRli+MeDergSQ== X-Received: by 2002:a17:902:aa8f:b029:df:c8a9:f8b4 with SMTP id d15-20020a170902aa8fb02900dfc8a9f8b4mr21704545plr.48.1612892001966; Tue, 09 Feb 2021 09:33:21 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:21 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 09/10] t7001: use here-docs instead of echo Date: Tue, 9 Feb 2021 23:02:53 +0530 Message-Id: <20210209173254.17712-10-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change from old style to current style by taking advantage of here-docs instead of echo commands. Signed-off-by: shubham verma --- t/t7001-mv.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 9a73232c7c..2e2e60e0d3 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -226,7 +226,10 @@ test_expect_success 'git mv to move multiple sources into a directory' ' git add dir/?.txt && git mv dir/a.txt dir/b.txt other && git ls-files >actual && - { echo other/a.txt; echo other/b.txt; } >expect && + cat >expect <<-\EOF && + other/a.txt + other/b.txt + EOF test_cmp expect actual ' From patchwork Tue Feb 9 17:32:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12078665 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 08842C433E0 for ; Tue, 9 Feb 2021 17:36:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB1D864EAA for ; Tue, 9 Feb 2021 17:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233239AbhBIRft (ORCPT ); Tue, 9 Feb 2021 12:35:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233014AbhBIRec (ORCPT ); Tue, 9 Feb 2021 12:34:32 -0500 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56F77C061797 for ; Tue, 9 Feb 2021 09:33:25 -0800 (PST) Received: by mail-pg1-x530.google.com with SMTP id o38so1382357pgm.9 for ; Tue, 09 Feb 2021 09:33:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Nk4q5nd/LypvBzcY+V6YogEme5FDVDhjyQE1s1sJCLE=; b=tU+oN6f2MOa+WlLwcg92pN0ihqwBb9bM8q2dlPJwWkuOA3JLIKi5H806j1qf/0zPh7 uSHI/uCtfKIiQLpqIhTJK6OUuywgKuYvIEd93x4kvfvO6TygOfwJBsa9m12okyGsJ32p SX9iLqA42/UQ94borumGItK6cezK4rAZoUWnDmF89gvutAff21xmsCs3bzlYlEXN2qcc PQd/GHAIGb0B2k+Qa2OfKyXYpdW1feLoVTY8+Wpnw8m22ak2wyQdShECmklWxp9a40WF VIoevhnhHCMr8SFK7nIx70UPfoOR7bdYX0k+OHb+VifBGK8nEFZ8liL7z5YGnPCDOZFh SUNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nk4q5nd/LypvBzcY+V6YogEme5FDVDhjyQE1s1sJCLE=; b=Ao8grYvg5T8C5xnvZy+VICVlzXQhiN7+26HTCuMzTRuTwNrQaSj80luxoYwZyxzHn5 PY+u18NXkdwzzfySld3oVBElqlQyutzIoNdH8VXbH1e5AzyPpY6rES7qGSnVaKFVgG2/ XWs40q/1yYz6a0eV08K/2gBuA3ii6jDBhaevwDGMdTrBfInvm1ibPhVyurHNVkY939xc DCyJHHrzQ087G6YemoAlYMRAW+0sIpSEAGfQRRQApNPt8zjs79Np9c3w29UKgLkdlvBj s9rc9ngTsD6ehGaP7LtqJMmK+pOo64ju2mzT8ZZoIs9oUvmQ0HGogJ18jjLh4CmNLFKu gmFA== X-Gm-Message-State: AOAM533J8CGnJjWKs14QaFeIBkHqnnDUbI3sS70q01ad/JH8Zeh12/59 7WLgqGtdxfNmv5Vsl7WW9TdAPrlaO1cjUg== X-Google-Smtp-Source: ABdhPJwumvVl2vUEAQSRbVAAWsZ0OiQAQH6VvRWl1WqN65b92bbfb/P2li/Aym/7jiugnWslFOuu3Q== X-Received: by 2002:a63:1d1c:: with SMTP id d28mr7830080pgd.216.1612892004426; Tue, 09 Feb 2021 09:33:24 -0800 (PST) Received: from localhost.localdomain ([47.9.143.68]) by smtp.gmail.com with ESMTPSA id g3sm20682607pfo.149.2021.02.09.09.33.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 09:33:23 -0800 (PST) From: shubham verma To: git@vger.kernel.org Subject: [PATCH v2 10/10] t7001: use `test` rather than `[` Date: Tue, 9 Feb 2021 23:02:54 +0530 Message-Id: <20210209173254.17712-11-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210209173254.17712-1-shubhunic@gmail.com> References: <20210209173254.17712-1-shubhunic@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org According to Documentation/CodingGuidelines, we should use "test" rather than "[ ... ]" in shell scripts, so let's replace the "[ ... ]" with "test" in the t7001 test script. Signed-off-by: shubham verma --- t/t7001-mv.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 2e2e60e0d3..002e188549 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -240,10 +240,10 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' ' git add dirty && entry="$(git ls-files --stage dirty | cut -f 1)" && git mv dirty dirty2 && - [ "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" && echo 2 >dirty2 && git mv dirty2 dirty && - [ "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ] + test "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ' rm -f dirty dirty2 @@ -330,7 +330,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm mkdir mod && git mv sub mod/sub && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && git update-index --refresh && git diff-files --quiet @@ -350,7 +350,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu mkdir mod && git mv sub mod/sub && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && echo mod/sub >expected && git config -f .gitmodules submodule.sub.path >actual && @@ -367,7 +367,7 @@ test_expect_success 'git mv moves a submodule with gitfile' ' mkdir mod && git -C mod mv ../sub/ . && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && echo mod/sub >expected && git config -f .gitmodules submodule.sub.path >actual && @@ -386,7 +386,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' ' git mv sub mod/sub 2>actual.err && test_must_be_empty actual.err && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && git update-index --refresh && git diff-files --quiet @@ -407,7 +407,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta git mv sub mod/sub 2>actual.err && test_must_be_empty actual.err && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && git update-index --refresh && git diff-files --quiet @@ -425,7 +425,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule git mv sub mod/sub 2>actual.err && test_i18ncmp expect.err actual.err && ! test -e sub && - [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] && + test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" && git -C mod/sub status && git update-index --refresh && git diff-files --quiet