Skip to content

Commit 90ed6c0

Browse files
Miklos Vajnagitster
authored andcommitted
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>
1 parent 7ee9066 commit 90ed6c0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

t/t7001-mv.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test_expect_success \
2222
test_expect_success \
2323
'checking the commit' \
2424
'git diff-tree -r -M --name-status HEAD^ HEAD | \
25-
grep -E "^R100.+path0/COPYING.+path1/COPYING"'
25+
grep "^R100..*path0/COPYING..*path1/COPYING"'
2626

2727
test_expect_success \
2828
'moving the file back into subdirectory' \
@@ -36,7 +36,7 @@ test_expect_success \
3636
test_expect_success \
3737
'checking the commit' \
3838
'git diff-tree -r -M --name-status HEAD^ HEAD | \
39-
grep -E "^R100.+path1/COPYING.+path0/COPYING"'
39+
grep "^R100..*path1/COPYING..*path0/COPYING"'
4040

4141
test_expect_success \
4242
'adding another file' \
@@ -55,9 +55,9 @@ test_expect_success \
5555
test_expect_success \
5656
'checking the commit' \
5757
'git diff-tree -r -M --name-status HEAD^ HEAD | \
58-
grep -E "^R100.+path0/COPYING.+path2/COPYING" &&
58+
grep "^R100..*path0/COPYING..*path2/COPYING" &&
5959
git diff-tree -r -M --name-status HEAD^ HEAD | \
60-
grep -E "^R100.+path0/README.+path2/README"'
60+
grep "^R100..*path0/README..*path2/README"'
6161

6262
test_expect_success \
6363
'succeed when source is a prefix of destination' \
@@ -74,9 +74,9 @@ test_expect_success \
7474
test_expect_success \
7575
'checking the commit' \
7676
'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" &&
7878
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"'
8080

8181
test_expect_failure \
8282
'do not move directory over existing directory' \

0 commit comments

Comments
 (0)