Skip to content

Commit ddb5287

Browse files
peffgitster
authored andcommitted
t7407: use test_grep
There are a few grep calls here that can benefit from test_grep, which produces more user-friendly output when it fails. One of these calls also passes "-sq", which is curious. The "-q" option suppresses the matched output. But test output is either already redirected to /dev/null in non-verbose mode, and in verbose mode it's better to see the output. The "-s" option suppresses errors opening files, but we are just grepping in the "expected" file we just generated, so it should not be needed. Neither of these was really hurting anything, but they are not a style we'd like to see emulated. So get rid of them. (It is also curious to grep in the expected file in the first place, but that is because we are auto-generating the expectation from a Git command. So this is double-checking it did what we wanted). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4f71522 commit ddb5287

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t7407-submodule-foreach.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,14 @@ test_expect_success 'option-like arguments passed to foreach commands are not lo
426426
git submodule foreach "echo be --quiet" > ../expected &&
427427
git submodule foreach echo be --quiet > ../actual
428428
) &&
429-
grep -sq -e "--quiet" expected &&
429+
test_grep -e "--quiet" expected &&
430430
test_cmp expected actual
431431
'
432432

433433
test_expect_success 'option-like arguments passed to foreach recurse correctly' '
434434
git -C clone2 submodule foreach --recursive "echo be --an-option" >expect &&
435435
git -C clone2 submodule foreach --recursive echo be --an-option >actual &&
436-
grep -e "--an-option" expect &&
436+
test_grep -e "--an-option" expect &&
437437
test_cmp expect actual
438438
'
439439

0 commit comments

Comments
 (0)