Skip to content

Commit 488acf1

Browse files
Shubhamlmpgitster
authored andcommitted
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 <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 39252c8 commit 488acf1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

t/t7001-mv.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
242242
git add dirty &&
243243
entry="$(git ls-files --stage dirty | cut -f 1)" &&
244244
git mv dirty dirty2 &&
245-
[ "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" ] &&
245+
test "$entry" = "$(git ls-files --stage dirty2 | cut -f 1)" &&
246246
echo 2 >dirty2 &&
247247
git mv dirty2 dirty &&
248-
[ "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ]
248+
test "$entry" = "$(git ls-files --stage dirty | cut -f 1)"
249249
'
250250

251251
rm -f dirty dirty2
@@ -332,7 +332,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
332332
mkdir mod &&
333333
git mv sub mod/sub &&
334334
! test -e sub &&
335-
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
335+
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
336336
git -C mod/sub status &&
337337
git update-index --refresh &&
338338
git diff-files --quiet
@@ -352,7 +352,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
352352
mkdir mod &&
353353
git mv sub mod/sub &&
354354
! test -e sub &&
355-
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
355+
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
356356
git -C mod/sub status &&
357357
echo mod/sub >expected &&
358358
git config -f .gitmodules submodule.sub.path >actual &&
@@ -369,7 +369,7 @@ test_expect_success 'git mv moves a submodule with gitfile' '
369369
mkdir mod &&
370370
git -C mod mv ../sub/ . &&
371371
! test -e sub &&
372-
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
372+
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
373373
git -C mod/sub status &&
374374
echo mod/sub >expected &&
375375
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' '
388388
git mv sub mod/sub 2>actual.err &&
389389
test_must_be_empty actual.err &&
390390
! test -e sub &&
391-
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
391+
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
392392
git -C mod/sub status &&
393393
git update-index --refresh &&
394394
git diff-files --quiet
@@ -409,7 +409,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta
409409
git mv sub mod/sub 2>actual.err &&
410410
test_must_be_empty actual.err &&
411411
! test -e sub &&
412-
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
412+
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
413413
git -C mod/sub status &&
414414
git update-index --refresh &&
415415
git diff-files --quiet
@@ -427,7 +427,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule
427427
git mv sub mod/sub 2>actual.err &&
428428
test_i18ncmp expect.err actual.err &&
429429
! test -e sub &&
430-
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
430+
test "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" &&
431431
git -C mod/sub status &&
432432
git update-index --refresh &&
433433
git diff-files --quiet

0 commit comments

Comments
 (0)