]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7001: use `test` rather than `[`
authorShubham Verma <shubhunic@gmail.com>
Thu, 11 Feb 2021 19:47:04 +0000 (01:17 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Feb 2021 21:42:17 +0000 (13:42 -0800)
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 <shubhunic@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7001-mv.sh

index c8c22c09e5a498133b318e9c9d385d957d69ae17..63d779d88620530a175ef6ee75c2bc4e255f762e 100755 (executable)
@@ -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