From patchwork Thu Feb 11 19:46:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083979 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 97311C433E9 for ; Thu, 11 Feb 2021 19:48:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6183664E45 for ; Thu, 11 Feb 2021 19:48:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231539AbhBKTs2 (ORCPT ); Thu, 11 Feb 2021 14:48:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbhBKTsM (ORCPT ); Thu, 11 Feb 2021 14:48:12 -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 94C62C061794 for ; Thu, 11 Feb 2021 11:47:14 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id q72so4015996pjq.2 for ; Thu, 11 Feb 2021 11:47:14 -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=uXSTEO0o7kDrTeqO38qlBwvzZxRkZ+or+LkXW1C9FOU=; b=WJOfKyDKFDiIG+1+wC3oORlGosKr3K98RGPjU5mWPsamtBox1W3VUxVKuMo3Oe7hvT NEHzDFyJeRl4A5TYv6bG2wBnNIH5LHYnzZC1BwIhDw+Ksjot60mwyF1C5y1HdSnC4GsH 8dvSgk/dsqr0+cYauvqMxg0BF5R01m54/Rf+kTA4gNwhxAhX85Sxy1g9bqtXKPdRLpAW MsIdGfhiGg66au4e5mYCQCLuI9kfVe5/BgaEl/noP94HrUV/Dh2RCrYhdkkwnpZK2PkQ YIFXHAl0rsncdBF1nYwFNp9jRHt+lsw6gcLgWqXk7XM35Hp55Bqct+I9/0ZfzdRRAX0U m2xw== 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=uXSTEO0o7kDrTeqO38qlBwvzZxRkZ+or+LkXW1C9FOU=; b=WPLLvR9MtIwJEbuSOIinO6jXVSpzprNrq3g5mBZZGb1hpbQEBIbF6/2Grem3bLeXle cjDNId9D0WnEfo+//OlqE4x+W3yRe+EMTZjxQkEJXs459ZyS0Sv5OjoujNq75j/aZX6f aWTwmuaJ6Pn4K+tFUxTSxagp9CbQrjoqVHYE/nyqeW0fBy56GiZ4T0JyQFdDWqevxVH1 mfb4puPd0WakDEJdT/44Zug8ORt0VQUCZeQ+5PYUQJf/PLX6MLR5UrEZCgXvU6CXkHhq 1GIfSHLDoAsdnjICB86vYxCOd+93jHtONMPnqskwetuOgGC+mDwSzc8AFnHBYU3Dpfjm IdHA== X-Gm-Message-State: AOAM533xvQWZ3O+6YUBC/4WbkgS5g51Uph9xcXmBqu8iR0Z4S2IarI0C I/04A3lugwmENgdUQdj225G3hbUJhNLczA== X-Google-Smtp-Source: ABdhPJz903d7C37wLSbQkbGifUknFg9+8iKZZiclyAkxkND63ZYh18y45mXUeP+xpZeX1nJIRdnF7g== X-Received: by 2002:a17:90a:ca09:: with SMTP id x9mr5492963pjt.52.1613072833697; Thu, 11 Feb 2021 11:47:13 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:13 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 01/10] t7001: modernize test formatting Date: Fri, 12 Feb 2021 01:16:55 +0530 Message-Id: <20210211194704.28913-2-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 Thu Feb 11 19:46:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083983 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 3500FC433E6 for ; Thu, 11 Feb 2021 19:49:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF77964DE9 for ; Thu, 11 Feb 2021 19:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231614AbhBKTso (ORCPT ); Thu, 11 Feb 2021 14:48:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbhBKTsQ (ORCPT ); Thu, 11 Feb 2021 14:48:16 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50D7EC0617A7 for ; Thu, 11 Feb 2021 11:47:17 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id k22so3885068pll.6 for ; Thu, 11 Feb 2021 11:47:17 -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=uGrxZl9dAzunzOcvSDb8Ny+ykoCovHrWNq9nuBmoDZE=; b=R2RO1gF2X+bc56digNfWWwnep1BBJzMGvGSGB9FsxL0DCSEEkMxA2IbPDm3rEgY3RW GkwJX/5pOHZqMDD+PYRYkY18tiyXMHcv3WzPK+CGUEt7mQoHrZqxNf8UXbcgoDNv+fP0 wRKsmVsYqX0Z5GLGAJ48oZyi84LmW5kOVoztvbB2/sdqteEn9zkbGjRzej/lg9PaD/7m qVcwf2co4ya1iitRa0u9KbiK8xujAJTkIVLO14eUhmRikbADw3NFtJonRoamhXJGQbtT wCEOzOyCe/yUQ9tWstD+s/cIy9JnnKNZoiN3vezN5TLzuBlPdio3i3vUmCxrD2kzACcT m2Yw== 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=uGrxZl9dAzunzOcvSDb8Ny+ykoCovHrWNq9nuBmoDZE=; b=SacK+PWJUgZSKhLRm4UyiLkR/OIx/pRS8GIyy5haIBP3FLw90/DkLh9Z0o8l7+wavw zDDKpS+zig6Dxk+nNJRHZZOc1xyWdLpNpNs0vKRuwzvLpeaaOzY372+XqRe+0N9ZH+Qn e+qTvbmZ8gM2eP0eBJ2Aty81uQRP1LaBtWYeqSJ+GWjCZjTnHoXUXXnrF99qav6AQ/W7 7rRjQYBftIVsCRLF5CMnobiXEfZ1rbjpw6el1OglakYYFSEAUXWjLzr5mb8GjaBRwhLd G+XdfsHAEwS56FAtYwWUBVFKG967o6E+ILeCGhY76gQlw58pzBEWIt9guNHSwZEENkNp d9+Q== X-Gm-Message-State: AOAM531Ezg+hic1k0W2UgpXPetjE/JCIoPFW/b10YhaBMOtEXqib5fNM sQPUfQfX0HfRYwapOwAUTDsvXEOsGSGmrw== X-Google-Smtp-Source: ABdhPJzRxqgDmSOsuZK3sqaY1lEbKxTa9Bhr7GnMrZaNEvkup71IUtkAXrScxijF3hcik0xKQXygzg== X-Received: by 2002:a17:902:6808:b029:e2:b405:fc0d with SMTP id h8-20020a1709026808b02900e2b405fc0dmr8701088plk.10.1613072835912; Thu, 11 Feb 2021 11:47:15 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:15 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 02/10] t7001: indent with TABs instead of spaces Date: Fri, 12 Feb 2021 01:16:56 +0530 Message-Id: <20210211194704.28913-3-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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..0f74c6339c 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 Thu Feb 11 19:46:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083981 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 0EE82C433E0 for ; Thu, 11 Feb 2021 19:49:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEC1164E45 for ; Thu, 11 Feb 2021 19:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbhBKTsi (ORCPT ); Thu, 11 Feb 2021 14:48:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbhBKTsQ (ORCPT ); Thu, 11 Feb 2021 14:48:16 -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 9CBFFC0617A9 for ; Thu, 11 Feb 2021 11:47:19 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id u15so3894850plf.1 for ; Thu, 11 Feb 2021 11:47:19 -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=tZev5n64exraIkBO6lpZsj5owZ1J75NCF+GxB3Z7Pgg=; b=rNkKGhh08l/sCHD3PsYw6x60TN5HPma/de523TOXzQZWhuwgKMJiZjE17D8dkiAtDU qqB31UiIHmhznAZyrUpu9UBAVfcUXg8Et1WwFkJyokOMjMtxVIFPrss9m48Mi3Xs5egA 2o2pYM5U+cqK/42drmtbj8Bhow3BIOcPKXBOzZfhsDXOQLMRjS2mjwuR74O9HfRHCqaS kg58nrXaM2P/l5eoiaCa9lLOwMaOElp42EmNqZMib98DGUvccsVtyCyjLnjabmixhkWy sS7vzLPFfsxCt3TeVb1CuAuHi8OGtfEHrPDTgaU0SyEQVYMzhWWDS0uZXFy2CPqFjeOD bvsA== 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=tZev5n64exraIkBO6lpZsj5owZ1J75NCF+GxB3Z7Pgg=; b=W6DfkhtY6BgC4bTTnQPiNgl1JMoVGuWaxIQhpu1epF3x0RrndfNUgcmQkk6GLJwWo7 q+XDydQURmf1eUzBFZCFxXVei1NVSl0kk7w270zQBlAXcSXxsOd3D9cjvmNyMjkL9OmR XLeWJJI2jbtf3MkgtrVIse4bg0SBYFnpzNP1ENoCTId50ZeByfqDm4Mh9mYnk1GJikFR 9df6A83ewQkFvKcAoKN/CEUDUIANx6bOK2LaUh35n4FxH9KveQrUC11u6o0yBkhH3SSr V2eB9faOZSqqVkEYvKgG9eE3eRQmOEYZ3/eQj0QvA3t6r70S+E2wP2WOlg5jr9KGysO5 9fJg== X-Gm-Message-State: AOAM531fxmRW8ZtnTopHZPeAl8nUPnrWXT0LfHSr9rLhpyuydhV+sed4 4YNlWT22BX/effnRcBbzyWLSXZ9VsvCtIA== X-Google-Smtp-Source: ABdhPJy2pkfRe1gT/lpTDAHsI0O4KqPOku7RpdtHxI301DKpN4yxmB0X81DReG7ucPHEo7+ECNZQkA== X-Received: by 2002:a17:90b:4c0b:: with SMTP id na11mr5138672pjb.45.1613072838672; Thu, 11 Feb 2021 11:47:18 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:18 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 03/10] t7001: remove unnecessary blank lines Date: Fri, 12 Feb 2021 01:16:57 +0530 Message-Id: <20210211194704.28913-4-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 0f74c6339c..e98b44f7a1 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 Thu Feb 11 19:46:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083989 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 158CDC433E9 for ; Thu, 11 Feb 2021 19:49:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD2B464E4D for ; Thu, 11 Feb 2021 19:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbhBKTtM (ORCPT ); Thu, 11 Feb 2021 14:49:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231451AbhBKTsR (ORCPT ); Thu, 11 Feb 2021 14:48:17 -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 8825EC0617AA for ; Thu, 11 Feb 2021 11:47:21 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id o63so4644203pgo.6 for ; Thu, 11 Feb 2021 11:47:21 -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=59HdyrGbW0mTL24biggdJfhnFcKsv/h3JsK/7auLcxk=; b=tPZPIdPnty1M2zzHGHCiJ+L5beaXpSJOIxf+GYd3LqpZG36lVHn9PCs8/WPY82I0C+ EH+2Ip4KxNpaI9d+4M5IWeIWjtEDHT4+87lLV1beECCjL0aLlqHrE6dB1hoCYu6m1hmw hAaUP7h71zmElSNS7sC8hx3m0hw27XrGTRdQlhszgLuEvW7gNSw+ZRpk4FcLTaHqS7z1 r5s94V6GdXw9cFwvFhncNoD7xjjm892DS+XSPEH+aoNmKPC/4NNprdqdY3o9omZ9dXPC rx3HNJylUuhJ/LwPAr6EvtOkg3ZOGXcEhEXf5NOcOHbsoFN3eMWMwD5sG/6bxgc1ZvJm zZOw== 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=59HdyrGbW0mTL24biggdJfhnFcKsv/h3JsK/7auLcxk=; b=U41WIPcLlpdGd/bo54+gfHvM1YegIgs/3gtyxe+I0NZuQ/9+yrJRPR8mgYa4sUKy+0 XvGgATGcsdT+og+x8/nPHYj5Z5UyKQXvPXXbDVquchBafYvH1DlS4j5ILDovmY/6Gxbm GQwWg1Tl7AUpUNcZ08J/nFnymZZXIFynNGQC6MCNmu59uU4ng5AvUmXDxF0PaugT3HT5 HZpnjp2hRLDAKn3Yorq7QmB5op2Tcj2uLodKv05Z6O3eSnQps55Ipne73ZX3s7yvmZbL EeumfS/bCgV4AkQIoDE81uKEmJbyLU/DdsVRM1p1aSA7O9yjw6Cb1wII7HWZI95f4tHv 8GYA== X-Gm-Message-State: AOAM533hBfXhLTnrgsawlOICeyzxWxsEiDdaz3lWOE8Bwjmrwufalcay YVT8wytLAqTEhjVRvQzfgU5dwW0zWNGW3w== X-Google-Smtp-Source: ABdhPJwHhwQqXnhtwYCpX4Cv0fDaEV6G7W5nKVbwzw+6qA2TCNFCyuf7dl85ubzT+EVoB4pVF6KuQA== X-Received: by 2002:a63:3648:: with SMTP id d69mr9564712pga.155.1613072840813; Thu, 11 Feb 2021 11:47:20 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:20 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 04/10] t7001: modernize subshell formatting Date: Fri, 12 Feb 2021 01:16:58 +0530 Message-Id: <20210211194704.28913-5-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 e98b44f7a1..7fd4341988 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 Thu Feb 11 19:46:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083985 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 C8E66C433DB for ; Thu, 11 Feb 2021 19:49:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83EF064E44 for ; Thu, 11 Feb 2021 19:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbhBKTs5 (ORCPT ); Thu, 11 Feb 2021 14:48:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231445AbhBKTsR (ORCPT ); Thu, 11 Feb 2021 14:48:17 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BD32C0617AB for ; Thu, 11 Feb 2021 11:47:23 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id x136so4366626pfc.2 for ; Thu, 11 Feb 2021 11:47:23 -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=e9FC9Rb+YR3BZHhsXijpSxgv4TfHEHmdAKhcZMs8egg=; b=tsDS3HYU1qxaFFnvoLfOm6M+eJDaPB3l2+xYVcl4nuKIIiHx8Ro0F/hBd2XKkCHbK2 +/rB8UxSQIjWWQFFqZxgNurLVjdNiQrFj8oP1SGR4AzZgwUB5CxXNCiilAEtumRNBJ9U B6tgPMJGF3KPt/a1EsJmB/SGk0AhfKyuDvFy4S85rY9DZ8tQgXoLjo8O/EkfeW2krl73 oNO3TbOpu6A0pn0AAkGNcItxgYOxAQhYatdC6jZsc56TIOTjxhLiPw4j4R1UxV+JmQMG 3Qdkwy1vxjB/lrnliR9MdIoaZR/p9nt6Wtm4U2+zJ4yLLs12lVnpfFkmUsnmTQBcGWyc 7yaA== 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=e9FC9Rb+YR3BZHhsXijpSxgv4TfHEHmdAKhcZMs8egg=; b=iQ9ebSjrjyKgCNVOWh489N4PxiOYVQ6D9iNa1wmPwEzXC7Ca0m29yCgZVmjfIeBdDT ZmRJwCBlBkJnUNSCxQpaS41mC0Ef0nKLLF5RjBicWHkuLusGc87tDZGD9HLvDmXh5r1S FeeG9YlKC8HcYHOw1wWMIGs0pp6IhlzskXU8SU9BhBpkflFOIHco/L7zKc9zkqi7/FHX s9qCAJodmko4xBOkc09cjQd9pAnRz50+z/qkqLZl8IW88BTWp6vytL8upye/XfLUeq72 05O5S6JY6eODzp9TdSXdichbsBeqsJqNLkD0GrjT0S6ggP6d7eM5ASpASwUNPB1ZBP+m lJ4A== X-Gm-Message-State: AOAM532fvms7pHS8BEVcFjLcsPKyF0w6oqUJLKaf3RFjNtvOg0HIST/o 342spLQen3urCSKenVByoprGAmC7nN474Q== X-Google-Smtp-Source: ABdhPJyyjNQZLZwIdPpq29iOGmScmhNLH1el4zB6XUpMfq+mw6nLfmCIkAI4o2Evlvkad7CaIk5pwg== X-Received: by 2002:a63:5525:: with SMTP id j37mr9692921pgb.191.1613072842771; Thu, 11 Feb 2021 11:47:22 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:22 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 05/10] t7001: remove whitespace after redirect operators Date: Fri, 12 Feb 2021 01:16:59 +0530 Message-Id: <20210211194704.28913-6-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 7fd4341988..2e49e9af81 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 Thu Feb 11 19:47:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083991 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 6C2A3C433E0 for ; Thu, 11 Feb 2021 19:49:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F2D464DE9 for ; Thu, 11 Feb 2021 19:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231540AbhBKTt1 (ORCPT ); Thu, 11 Feb 2021 14:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231571AbhBKTsd (ORCPT ); Thu, 11 Feb 2021 14:48:33 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9E8C061356 for ; Thu, 11 Feb 2021 11:47:25 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id l18so4025571pji.3 for ; Thu, 11 Feb 2021 11:47: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=nNJRwLOcEvrOVGiaQx/Ydlqpt9SLFaOr70gDT0alteM=; b=XIcSVzF7xN39Xaf+YLV0WvjlSKbOLjc8ENJE86gVhpn2evm76TmYDoPlomdIFkl2QR +mpfhoJhFIzzOw685zltg0q5AhtUtCcyJ8IIuZR1wS2xik10YkYa7rz/mgp9aCjbg8Mf XbZqYmVCSid5SnrXZMyY7TIobjsKhThyVsEsgxujRxXKreSJwO3l/SHJKUGBeiyivyxH J5+6OuLnbTU9f/ZTGdMhpQ9JqGtdhoYpSqujMSMWNAgQsAhU9wxY2ZbSmp9q4QxNfE9D Pkn5hhDne2ODnqRYoWw6KgXpKAKiFKKbvEIKg+zguXUXjrWknlQcPl4HvB5lBi4Gte02 801w== 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=nNJRwLOcEvrOVGiaQx/Ydlqpt9SLFaOr70gDT0alteM=; b=qcZDRAZ470oet2jPLCU3lh/1y2/fmZE4K15SeTlb4+7Z3fIzyVEwE/C4oqox1bBsQs 7DwQ61uBaZgbt/3ABc6H0oa9vZeM7x626QeA0bPKE8Bp6NxGUptcz2HYae6BFuarSxxU JuIJLNZp6Pq2pGrXEGXut6WPcqbNVYHobTMh/+hLnnckhbNKy1Yd6Y7nyF6bcjd/Bf0G qbJoj43CI2N90ElzRZm69KsgFcND1FiAX7FJ0FW4yuynuv3uaCFbcx7sVyp6yEQ6pZBY n7BI2D2cRwlD6cToo4I/74CIdZ8OO2Cz6kFD/TTIsPneLhMO1NpGlT/US9ifQLzLcZc+ uzVA== X-Gm-Message-State: AOAM532I16db+YS30aDQ9Jhd3MTLFHWNqjvQiBituL75UVJaCmmMEn8u KZ9y6pe+xexb4Gvy6vKhkUFS/P4Zusi0bA== X-Google-Smtp-Source: ABdhPJwRDMib6NMkEUxWvD95PIRt0T+kaTHyGo4HMgNTRMGFxtYx2UZioPp54GEihoLeoQak1TTg/w== X-Received: by 2002:a17:90a:f302:: with SMTP id ca2mr5421367pjb.233.1613072844665; Thu, 11 Feb 2021 11:47:24 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:24 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 06/10] t7001: avoid using `cd` outside of subshells Date: Fri, 12 Feb 2021 01:17:00 +0530 Message-Id: <20210211194704.28913-7-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 2e49e9af81..6412c4f882 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -11,12 +11,12 @@ 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 +25,12 @@ 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 +328,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 +348,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 +362,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 +384,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 +405,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 +423,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 Thu Feb 11 19:47:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083987 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 3EF01C43381 for ; Thu, 11 Feb 2021 19:49:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F22BE64E44 for ; Thu, 11 Feb 2021 19:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231334AbhBKTtV (ORCPT ); Thu, 11 Feb 2021 14:49:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbhBKTsd (ORCPT ); Thu, 11 Feb 2021 14:48:33 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F3D5C061574 for ; Thu, 11 Feb 2021 11:47:28 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id r38so4626802pgk.13 for ; Thu, 11 Feb 2021 11:47:28 -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=SHwKAsKrEoWrKBhY2PawvgB+vBiv6nowp261v5wtFSg=; b=P9ZPbso7wlMi0yw/CRibVixN0iHZr7t4Rmg98eqc8BwJV16Vwy1HJeWmG4kgmUQHdy DqGIrOk8ql98Nba+kQ+8k2P18PFoHmtn7WplD9hqjNiX/WQtfN7RgMNfQxFt/Z4B+UgX qzsEdltIqNdxurIqHZuBfCLZU4AkjVymiEhez2uMSCtrf6ID6B+LFXEeco1lEG2Y4sTC yYMmctjUpYb69fWl3qgmOX0lpKyiOrVinN1ikkdG44u3Rp8Y5l8po8Q371fyNi7jvZ2V EtatazSbKYBgMWc/OAmPMkPww50vpMnCNlqpCP91dw8alURgmTUTTSgi7kCL+P+SXWft 78Yg== 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=SHwKAsKrEoWrKBhY2PawvgB+vBiv6nowp261v5wtFSg=; b=VVXpfoMj8AJBCE7obdEkrEb9tM73OzAacEN5XPxvwCNWBXepeAwfZM+Xori8mhOXyz pFnFOmPMugnc8AeQzG8WM5dKg8gGj9mEzbMWPu4Tqth4zHXdviwH87mim3YA9rcaiHm+ VFh08RlDwpcnpBPPlXnxoH09qOIJP9TMtMLwjJtuPjAsadYEreGJEIdLrsqxDoM7pgtx 5NtD95XFXhWekkL2CXnki9IaHtTvId3M/ZOyg+/HwBQ9tAmg0K57Koy9XaQBH8IjRmh9 Je+14iQotFEWz5pGk+X16xc4s6G2bt82+HfefAKv7rnJCgZ/omiNUcy86kfXXpT8E4g2 bX9Q== X-Gm-Message-State: AOAM531aLU1TFJy/YAPXmNBBzfYfaoyNMyE+T015bFHvcnGg3cP3EJOx m3dCC2LQWqnc6a0U5oa3n3UoQlK6JQFoAg== X-Google-Smtp-Source: ABdhPJx4JR1cJ6U7wGsl8Gr5KtpaqWOSW5/Edu7oGyZF7WyrkpO4LtKlhaXkc5rN0iX8r0lkN88tAQ== X-Received: by 2002:a05:6a00:1a46:b029:1d5:9acd:798c with SMTP id h6-20020a056a001a46b02901d59acd798cmr9160212pfv.25.1613072847330; Thu, 11 Feb 2021 11:47:27 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:26 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 07/10] t7001: use '>' rather than 'touch' Date: Fri, 12 Feb 2021 01:17:01 +0530 Message-Id: <20210211194704.28913-8-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 6412c4f882..a56580b26d 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -49,14 +49,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 && @@ -65,7 +65,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 && @@ -488,7 +488,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" @@ -496,7 +496,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 Thu Feb 11 19:47:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083995 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 0F878C433E6 for ; Thu, 11 Feb 2021 19:50:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE04B64E6F for ; Thu, 11 Feb 2021 19:50:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbhBKTty (ORCPT ); Thu, 11 Feb 2021 14:49:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231634AbhBKTs6 (ORCPT ); Thu, 11 Feb 2021 14:48:58 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8557FC06121C for ; Thu, 11 Feb 2021 11:47:30 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id nm1so4017401pjb.3 for ; Thu, 11 Feb 2021 11:47:30 -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=w6uxotFd3fl3bEKZPRvoeYnHz6L8s8rSINMCS3nH4E0=; b=EwTs6us7bZwKTGD/fBJm0OPckC/tNWq1T3zpwiIGmSmW6PJ7ItWUCSEdHK1daozR6g mpdKyp+ZIOtd+uY42pmM/cceuIRNECojGxT7p7Qo0lpvWetMcqmyoqyZpQ2irDWDc7Ut kuT5QI50+a1DMc4mwAUTXZiq0LKlSf13NQnOqF96dQnbvsdHN7iUZNKd+jgrG8kd8xkz RJzbEdBzflTAYYsjrgKPCSX24eTM4JkiJVwiASYAtvID6/4I7BBhY0T45SKvcmZdV3Xq wym1pkP6CCQQSv2va8h5DcgX2qm3OAhO/GG9n3vr+ldjccme6OyVmOv84ZnEaF+BLfE9 rUog== 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=w6uxotFd3fl3bEKZPRvoeYnHz6L8s8rSINMCS3nH4E0=; b=jn6aaw5p5FEhUWDWx8pSJDnfJjd1L4A8BaSivZQXZ4FjD6/At6AND+uPkUfoy8aohl yJdb2hWx9gYar3fVQxUaO2OCKhsXoGeJngnLZqeMw0reUrrlzVWd2eaNm+vjhb1aAbJt Er87mo3ftyq1MSanzg5DIbfWOfpZY7OBgD1SHoVicOSsti1hCjf5nniFL2XbhiC1Lyd7 OqGrAgwLtUXXgKcpAO0UCBCLlfZrz6sE5w4fQJI9WaKg2qJELv2PKVD15c/NA5mtN20j /TuHd4tnuuaE7+szEwzO1eJm/nnKQRFXqk+HG+qN382yoS/Zr0C8/WVBnjh1h4VN54cT /hyA== X-Gm-Message-State: AOAM530z6VHhfFXukbNDQFgz9VgI2mZId3hurv0QgnqguE6oeHPFqf7s +NCOEaawlgN4TrOgVvucxsXvKS6U1ZUtrg== X-Google-Smtp-Source: ABdhPJyXzTW2/PDgc7+YPQZgSf0wh7Iz5ZkIgP8BntJ0r/DFRUUjEBVm4/tsdmwzn4zYSSxq+3DsDg== X-Received: by 2002:a17:902:8602:b029:e2:8386:7aed with SMTP id f2-20020a1709028602b02900e283867aedmr9183996plo.36.1613072849763; Thu, 11 Feb 2021 11:47:29 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:29 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 08/10] t7001: put each command on a separate line Date: Fri, 12 Feb 2021 01:17:02 +0530 Message-Id: <20210211194704.28913-9-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 a56580b26d..93d6767951 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -145,7 +145,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 Thu Feb 11 19:47:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083997 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 76A6DC433E0 for ; Thu, 11 Feb 2021 19:50:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A7B364E57 for ; Thu, 11 Feb 2021 19:50:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbhBKTuN (ORCPT ); Thu, 11 Feb 2021 14:50:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231639AbhBKTs6 (ORCPT ); Thu, 11 Feb 2021 14:48:58 -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 E2A22C061756 for ; Thu, 11 Feb 2021 11:47:32 -0800 (PST) Received: by mail-pf1-x42b.google.com with SMTP id q20so4351783pfu.8 for ; Thu, 11 Feb 2021 11:47:32 -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=l6ktkneQ9gqnysnae9q5dUuZ67jn2ChwM6a/SbFPy4o=; b=dhuMB8uzUSYQ14Sd4mUY+7gnSckoPhGwgagDUT7xuW4SAOkgNf/4iG/tjS7U60ZrVn QwYjO8QSGstgz85Czx0dtGbDl5kfZpcm9BSj6GDb4btOTUAeZ4KidS5YMxcVIm/sHUKl vmj4zZ5EQVEEFeOjqoZuuhJrkRKmm7eREWPAcyQc1XltgjkJ+T4tdBH1FbPMEB4t4SnC x0Nr/by4A70Eh1NAjTqxrW1E2blLK1Xl4uYVHVbUPs7l6MFwards+/r+XtRKK8eKPO21 reDUnAMB1HAWD6jBkzcZlQIxuDKU7YBKwKLcscTlyKxVTRJGjEvgKZqzrRO2O1PezIoc rxbQ== 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=l6ktkneQ9gqnysnae9q5dUuZ67jn2ChwM6a/SbFPy4o=; b=QRrOrB8wLv0Hff9ygVQEFCyp1WaNKhZPXi0f9xcPkhsF1/slpmCkCWsQ0bEVCFudVz aS/OKWwDL2A74J6BCJtjulOAJOPckEkESG9I1tAS4/0zmiJxTAn8pYiHB/o4OiLV5KeI 0lE73qX5EeyK2A9yZBb5K/3xGhqFjjOo+d79roPMz/g4aerG3C4DbLydOTlA7m4NthvR F/frYBSgYc6n2LCwOB8SsNNHfgenyshK+rFRlHYFWzT3rEnVcSIh46Q3O2kjOOpvgrVC 9qj0lXnwBhHNlMF+fB8EG66ILS31pFsfS8fR8Vt9ZPHYwqUUyJoiFbJ6mR3IWSnZPxOf 5gLw== X-Gm-Message-State: AOAM533pkVgwA18p9tHHHxIz+EmhTQuHTf4ZUWu5MjHkycT2gTAmAtjG qcKi/zWJc5swJFAQ66vM7GMU1wiYT2UsvA== X-Google-Smtp-Source: ABdhPJz0cTYJwNVl7ZSIkC7ubOo8PokLS6oV7rHUltqSjXsve1hpC3LEZ3/DI1vgTN1jT9E3/AV7rA== X-Received: by 2002:a63:4f1f:: with SMTP id d31mr9927159pgb.104.1613072852156; Thu, 11 Feb 2021 11:47:32 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:31 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 09/10] t7001: use here-docs instead of echo Date: Fri, 12 Feb 2021 01:17:03 +0530 Message-Id: <20210211194704.28913-10-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 93d6767951..36a274e96d 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -228,7 +228,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 Thu Feb 11 19:47:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubham Verma X-Patchwork-Id: 12083993 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 8C6ADC433DB for ; Thu, 11 Feb 2021 19:49:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57CE064E56 for ; Thu, 11 Feb 2021 19:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231592AbhBKTtj (ORCPT ); Thu, 11 Feb 2021 14:49:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231585AbhBKTsf (ORCPT ); Thu, 11 Feb 2021 14:48:35 -0500 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 775E5C0613D6 for ; Thu, 11 Feb 2021 11:47:35 -0800 (PST) Received: by mail-pg1-x533.google.com with SMTP id r38so4626996pgk.13 for ; Thu, 11 Feb 2021 11:47:35 -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=2cKequipcTVvNC8X9O6rKP+MGRBOoScdRpmzBk0xiAg=; b=pev0LCrXzbZl4ZB4GdYApP2AMbjgh7+iql2pzeKDRXDAVsGroF7NdUPDUwLIdpPmZb 6iF6km5X0EpKxSJGO0mYRjbu5jV0pSbi+CzGmN8EOTnfBFkCf6ipU7/EDwB4HK/oBwRs 971YiZcwsWXsp8taBXzFes3iaoFBM+W+E0Sn8h1xaDuT+pcn068abSza94KgOwCWLeQW Ngk+Gk/40E5ztdLHFg+TktX1OKTeVic7M+3LYGeeIC30Dvu1j6ZwBs/MA9YiyqJo8fRW m1jJzg2wvAjYeJ6mdD0EmKeKXsr0nax63Ek8HmUbxXfhlvHiNgDzm0aBvpbJngoi7sMt dJRw== 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=2cKequipcTVvNC8X9O6rKP+MGRBOoScdRpmzBk0xiAg=; b=K9BIof9+vY4MJMEdUGW+dm/MuqFg+7hkQ6JN5pzoYXIdoBntV+noFvGdor2HP58XXT 7q4+4u9xOnNrfuLkQi/R0T3PhXrOLfzJsMsGoMqA2bBJu4FmiFt/9uOfuE6a7DPoVBB9 pqRFsn2WYZk1tDrqrT8h7AkiZhBrOz7sVrNghRLAi7jsV1vzusxsvxFUK/72VvmRMXYQ wADzb98OuYyQkGzRnQ27OFcQtq6cRnLrk17hAWiIJ14r5iMNKB+OaS75X5gZrTzbO017 EYZpBbKjzgDmKDZDCth0ZwX2rQT/zLgQ6JPcEAmadDQLk/a6lKYZZuKENp5rXv4laeDP loWg== X-Gm-Message-State: AOAM532jfjOQYl/dKekqGqUxiZ4R901POJwc4HQ+SZyB+eGErYTLfDtq t3vnHGn6yuevZ+p8GqHOByfi9Xm3Xv/Ahg== X-Google-Smtp-Source: ABdhPJyv/S+e0YZ4LCLfTCwmYVfkRbiGe+MPErSIxT9vwkfEEPNNVSRTe/qGf8vCCLWQy7bxsTYgQw== X-Received: by 2002:a63:2009:: with SMTP id g9mr9464190pgg.219.1613072854731; Thu, 11 Feb 2021 11:47:34 -0800 (PST) Received: from localhost.localdomain ([47.8.36.172]) by smtp.gmail.com with ESMTPSA id a141sm6524778pfa.189.2021.02.11.11.47.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 11:47:34 -0800 (PST) From: Shubham Verma To: git@vger.kernel.org Subject: [PATCH v3 10/10] t7001: use `test` rather than `[` Date: Fri, 12 Feb 2021 01:17:04 +0530 Message-Id: <20210211194704.28913-11-shubhunic@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194704.28913-1-shubhunic@gmail.com> References: <20210211194704.28913-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 36a274e96d..65807e4873 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -242,10 +242,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 @@ -332,7 +332,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 @@ -352,7 +352,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 && @@ -369,7 +369,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 && @@ -388,7 +388,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 @@ -409,7 +409,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 @@ -427,7 +427,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