Skip to content

Commit fc42f20

Browse files
szedergitster
authored andcommitted
test-lib-functions: suppress a 'git rev-parse' error in 'test_commit_bulk'
When 'test_commit_bulk' is invoked in an empty test repository, it prints a "fatal: Needed a single revision" error, but still does what it's supposed to do. A test helper function displaying a fatal error and still succeeding is always suspect to be buggy, but luckily that's not the case here: that error comes from a 'git rev-parse --verify HEAD' command invoked in a condition, which doesn't have anything to verify in an empty repository. Use the '--quiet' option to suppress that error message. Signed-off-by: SZEDER Gábor <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5fa0f52 commit fc42f20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/test-lib-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ test_commit_bulk () {
306306
total=$1
307307

308308
add_from=
309-
if git -C "$indir" rev-parse --verify "$ref"
309+
if git -C "$indir" rev-parse --quiet --verify "$ref"
310310
then
311311
add_from=t
312312
fi

0 commit comments

Comments
 (0)