t7001: use '>' rather than 'touch'
Use `>` rather than `touch` to create an empty file when the timestamp isn't relevant to the test. 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
d2ecddc9816e6e0b9732046be9e926b42d4b3226
1 file changed
+5
-5
t/t7001-mv.sh
+5
-5
@@ -49,14 +49,14 @@ test_expect_success 'checking -k on non-existing file' '
49
'
50
51
test_expect_success 'checking -k on untracked file' '
52
- touch untracked1 &&
52
+ >untracked1 &&
53
git mv -k untracked1 path0 &&
54
test -f untracked1 &&
55
test ! -f path0/untracked1
56
'
57
58
test_expect_success 'checking -k on multiple untracked files' '
59
- touch untracked2 &&
59
+ >untracked2 &&
60
git mv -k untracked1 untracked2 path0 &&
61
test -f untracked1 &&
62
test -f untracked2 &&
@@ -65,7 +65,7 @@ test_expect_success 'checking -k on multiple untracked files' '
65
'
66
67
test_expect_success 'checking -f on untracked file with existing target' '
68
- touch path0/untracked1 &&
68
+ >path0/untracked1 &&
69
test_must_fail git mv -f untracked1 path0 &&
70
test ! -f .git/index.lock &&
71
test -f untracked1 &&
@@ -488,7 +488,7 @@ test_expect_success 'moving nested submodules' '
488
mkdir sub_nested_nested &&
489
(
490
cd sub_nested_nested &&
491
- touch nested_level2 &&
491
+ >nested_level2 &&
492
git init &&
493
git add . &&
494
git commit -m "nested level 2"
@@ -496,7 +496,7 @@ test_expect_success 'moving nested submodules' '
496
mkdir sub_nested &&
497
(
498
cd sub_nested &&
499
- touch nested_level1 &&
499
+ >nested_level1 &&
500
git init &&
501
git add . &&
502
git commit -m "nested level 1" &&