t7001: use test
rather than [
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>
This commit is contained in:
parent
39252c833e
commit
488acf15df
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user