@matheusbsbs / matheus-bagliano / commits / 9a3c6f7ba7
Fork 0

Fix t5516-fetch for systems where `wc -l` outputs whitespace.

When wc outputs whitespace, the test "$(command | wc -l)" = 1 is broken because " 1" != "1". Let the shell eat the whitespace by using test 1 = $(command | wc -l) instead. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brian Gernhardt committed Jul 1, 2007 at 11:48 UTC 9a3c6f7ba7c567e277da58a45ac6fa50461297e3
1 file changed +2 -2
t/t5516-fetch-push.sh
+2 -2
@@ -226,7 +226,7 @@ test_expect_success 'push with colon-less refspec (3)' '
226 git branch -f frotz master &&
227 git push testrepo frotz &&
228 check_push_result $the_commit heads/frotz &&
229 - test "$( cd testrepo && git show-ref | wc -l )" = 1
229 + test 1 = $( cd testrepo && git show-ref | wc -l )
230 '
231
232 test_expect_success 'push with colon-less refspec (4)' '
@@ -239,7 +239,7 @@ test_expect_success 'push with colon-less refspec (4)' '
239 git tag -f frotz &&
240 git push testrepo frotz &&
241 check_push_result $the_commit tags/frotz &&
242 - test "$( cd testrepo && git show-ref | wc -l )" = 1
242 + test 1 = $( cd testrepo && git show-ref | wc -l )
243
244 '
245