]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5520: use test_line_count where possible
authorDenton Liu <liu.denton@gmail.com>
Tue, 12 Nov 2019 23:08:00 +0000 (15:08 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Nov 2019 00:41:51 +0000 (09:41 +0900)
Instead of rolling our own functionality to test the number of lines a
command outputs, use test_line_count() which provides better debugging
information in the case of a failure.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5520-pull.sh

index 7bb9031140dfc36d88246e6e3c69b16ef0fa9baf..0ca4867e9683fe84e3019324b7781d6bb9a3bedf 100755 (executable)
@@ -699,7 +699,8 @@ test_expect_success 'git pull --rebase does not reapply old patches' '
        (
                cd dst &&
                test_must_fail git pull --rebase &&
-               test 1 = $(find .git/rebase-apply -name "000*" | wc -l)
+               find .git/rebase-apply -name "000*" >patches &&
+               test_line_count = 1 patches
        )
 '