From fc42f20e243db941fb58e5ef43e3654034738326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Mon, 25 Nov 2019 13:59:07 +0100 Subject: [PATCH] test-lib-functions: suppress a 'git rev-parse' error in 'test_commit_bulk' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Jeff King Signed-off-by: Junio C Hamano --- t/test-lib-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index e0b3f28d3a96e1..a2e9d6ae2e84e2 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -306,7 +306,7 @@ test_commit_bulk () { total=$1 add_from= - if git -C "$indir" rev-parse --verify "$ref" + if git -C "$indir" rev-parse --quiet --verify "$ref" then add_from=t fi