push test: simplify check of push result
commit848575d833ca0d9d47db372348576f3b98bd19b7
authorJonathan Nieder <jrnieder@gmail.com>
Mon, 18 Mar 2013 23:13:41 +0000 (18 16:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Mar 2013 18:07:26 +0000 (19 11:07 -0700)
treea81b6e6eb516e60ad9955978bcbdcaa1535879f2
parent3c695523384855dffba49aec7f0a77e555ced822
push test: simplify check of push result

This test checks each ref with code like the following:

r=$(git show-ref -s --verify refs/$ref) &&
test "z$r" = "z$the_first_commit"

Afterward it counts refs:

test 1 = $(git for-each-ref refs/remotes/origin | wc -l)

Simpler to test the number and values of relevant refs in for-each-ref
output at the same time using test_cmp.  This makes the test more
readable and provides more helpful "./t5516-push-push.sh -v" output
when the test fails.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5516-fetch-push.sh