Skip to content

Commit

Permalink
Fix t5516-fetch for systems where wc -l outputs whitespace.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brian Gernhardt authored and Junio C Hamano committed Jul 1, 2007
1 parent 2031427 commit 9a3c6f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/t5516-fetch-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ test_expect_success 'push with colon-less refspec (3)' '
git branch -f frotz master &&
git push testrepo frotz &&
check_push_result $the_commit heads/frotz &&
test "$( cd testrepo && git show-ref | wc -l )" = 1
test 1 = $( cd testrepo && git show-ref | wc -l )
'

test_expect_success 'push with colon-less refspec (4)' '
Expand All @@ -239,7 +239,7 @@ test_expect_success 'push with colon-less refspec (4)' '
git tag -f frotz &&
git push testrepo frotz &&
check_push_result $the_commit tags/frotz &&
test "$( cd testrepo && git show-ref | wc -l )" = 1
test 1 = $( cd testrepo && git show-ref | wc -l )
'

Expand Down

0 comments on commit 9a3c6f7

Please sign in to comment.