Skip to content

Commit

Permalink
t5516: Use test_cmp when appropriate
Browse files Browse the repository at this point in the history
Consistently using test_cmp would make debugging test scripts far easier,
as output from them run under "-v" option becomes readable.

Besides, some platforms' "diff" implementations lack "-q" option.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 12, 2010
1 parent fbe4f44 commit c296134
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/t5516-fetch-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ test_expect_success 'push --porcelain' '
test "z$r" = "z$the_commit" &&
test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
) &&
diff -q .git/foo .git/bar
test_cmp .git/foo .git/bar
'

test_expect_success 'push --porcelain bad url' '
Expand All @@ -692,7 +692,7 @@ test_expect_success 'push --porcelain rejected' '
echo >>.git/foo "! refs/heads/master:refs/heads/master [remote rejected] (branch is currently checked out)" &&
test_must_fail git push >.git/bar --porcelain testrepo refs/heads/master:refs/heads/master &&
diff -q .git/foo .git/bar
test_cmp .git/foo .git/bar
'

test_expect_success 'push --porcelain --dry-run rejected' '
Expand All @@ -707,7 +707,7 @@ test_expect_success 'push --porcelain --dry-run rejected' '
echo >>.git/foo "Done" &&
test_must_fail git push >.git/bar --porcelain --dry-run testrepo refs/heads/master^:refs/heads/master &&
diff -q .git/foo .git/bar
test_cmp .git/foo .git/bar
'

test_done

0 comments on commit c296134

Please sign in to comment.