t/t7001: avoid unnecessary ERE when using grep
As pointed out by Junio, it's unnecessary to use "grep -E" and ".+" when we can just use "grep" and "..*". Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Miklos Vajna committed
Jan 5, 2008 at 05:06 UTC
90ed6c0576156d356aa35ee79aaf85825f9566f6
1 file changed
+6
-6
t/t7001-mv.sh
+6
-6
@@ -22,7 +22,7 @@ test_expect_success \
22
test_expect_success \
23
'checking the commit' \
24
'git diff-tree -r -M --name-status HEAD^ HEAD | \
25
- grep -E "^R100.+path0/COPYING.+path1/COPYING"'
25
+ grep "^R100..*path0/COPYING..*path1/COPYING"'
26
27
test_expect_success \
28
'moving the file back into subdirectory' \
@@ -36,7 +36,7 @@ test_expect_success \
36
test_expect_success \
37
'checking the commit' \
38
'git diff-tree -r -M --name-status HEAD^ HEAD | \
39
- grep -E "^R100.+path1/COPYING.+path0/COPYING"'
39
+ grep "^R100..*path1/COPYING..*path0/COPYING"'
40
41
test_expect_success \
42
'adding another file' \
@@ -55,9 +55,9 @@ test_expect_success \
55
test_expect_success \
56
'checking the commit' \
57
'git diff-tree -r -M --name-status HEAD^ HEAD | \
58
- grep -E "^R100.+path0/COPYING.+path2/COPYING" &&
58
+ grep "^R100..*path0/COPYING..*path2/COPYING" &&
59
git diff-tree -r -M --name-status HEAD^ HEAD | \
60
- grep -E "^R100.+path0/README.+path2/README"'
60
+ grep "^R100..*path0/README..*path2/README"'
61
62
test_expect_success \
63
'succeed when source is a prefix of destination' \
@@ -74,9 +74,9 @@ test_expect_success \
74
test_expect_success \
75
'checking the commit' \
76
'git diff-tree -r -M --name-status HEAD^ HEAD | \
77
- grep -E "^R100.+path2/COPYING.+path1/path2/COPYING" &&
77
+ grep "^R100..*path2/COPYING..*path1/path2/COPYING" &&
78
git diff-tree -r -M --name-status HEAD^ HEAD | \
79
- grep -E "^R100.+path2/README.+path1/path2/README"'
79
+ grep "^R100..*path2/README..*path1/path2/README"'
80
81
test_expect_failure \
82
'do not move directory over existing directory' \