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>
Shubham Verma committed
Feb 12, 2021 at 01:17 UTC
488acf15dfa3edec67fa0397d6d09b247c0c46ae
1 file changed
+8
-8
t/t7001-mv.sh
+8
-8
@@ -242,10 +242,10 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
242
git add dirty &&
243
entry="$(git ls-files --stage dirty | cut -f 1)" &&
244
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)" &&
246
echo 2 >dirty2 &&
247
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)"
249
'
250
251
rm -f dirty dirty2
@@ -332,7 +332,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
332
mkdir mod &&
333
git mv sub mod/sub &&
334
! 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)" &&
336
git -C mod/sub status &&
337
git update-index --refresh &&
338
git diff-files --quiet
@@ -352,7 +352,7 @@ test_expect_success 'git mv moves a submodule with a .git directory and .gitmodu
352
mkdir mod &&
353
git mv sub mod/sub &&
354
! 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)" &&
356
git -C mod/sub status &&
357
echo mod/sub >expected &&
358
git config -f .gitmodules submodule.sub.path >actual &&
@@ -369,7 +369,7 @@ test_expect_success 'git mv moves a submodule with gitfile' '
369
mkdir mod &&
370
git -C mod mv ../sub/ . &&
371
! 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)" &&
373
git -C mod/sub status &&
374
echo mod/sub >expected &&
375
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' '
388
git mv sub mod/sub 2>actual.err &&
389
test_must_be_empty actual.err &&
390
! 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)" &&
392
git -C mod/sub status &&
393
git update-index --refresh &&
394
git diff-files --quiet
@@ -409,7 +409,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta
409
git mv sub mod/sub 2>actual.err &&
410
test_must_be_empty actual.err &&
411
! 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)" &&
413
git -C mod/sub status &&
414
git update-index --refresh &&
415
git diff-files --quiet
@@ -427,7 +427,7 @@ test_expect_success 'mv issues a warning when section is not found in .gitmodule
427
git mv sub mod/sub 2>actual.err &&
428
test_i18ncmp expect.err actual.err &&
429
! 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)" &&
431
git -C mod/sub status &&
432
git update-index --refresh &&
433
git diff-files --quiet