From 213dabf49dc53ae5808efbdebf0cd2bfc2c1bfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Tue, 26 Nov 2019 20:46:07 +0100 Subject: test: use test_must_be_empty F instead of test -z $(cat F) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use test_must_be_empty instead of reading the file and comparing its contents to an empty string. That's more efficient, as the function only needs built-in meta-data only check in the usual case, and provides nicer debug output otherwise. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- t/t6019-rev-list-ancestry-path.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/t6019-rev-list-ancestry-path.sh') diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh index beadaf6cca..353f84313f 100755 --- a/t/t6019-rev-list-ancestry-path.sh +++ b/t/t6019-rev-list-ancestry-path.sh @@ -143,14 +143,14 @@ test_expect_success 'setup criss-cross' ' test_expect_success 'criss-cross: rev-list --ancestry-path cb..bc' ' (cd criss-cross && git rev-list --ancestry-path xcb..xbc > actual && - test -z "$(cat actual)") + test_must_be_empty actual) ' # no commits in repository descend from cb test_expect_success 'criss-cross: rev-list --ancestry-path --all ^cb' ' (cd criss-cross && git rev-list --ancestry-path --all ^xcb > actual && - test -z "$(cat actual)") + test_must_be_empty actual) ' test_done -- cgit v1.2.3