tests: use "test_cmp", not "diff", when verifying the result

In tests, call test_cmp rather than raw diff where possible (i.e. if
the output does not go to a pipe), to allow the use of, say, 'cmp'
when the default 'diff -u' is not compatible with a vendor diff.

When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Gary V. Vaughan
2010-05-14 09:31:37 +00:00
committed by Junio C Hamano
parent d1b1a91946
commit 4fdf71be1c
19 changed files with 59 additions and 55 deletions

View File

@ -43,7 +43,7 @@ test_expect_success \
git branch -l d/e/f &&
test -f .git/refs/heads/d/e/f &&
test -f .git/logs/refs/heads/d/e/f &&
diff expect .git/logs/refs/heads/d/e/f'
test_cmp expect .git/logs/refs/heads/d/e/f'
test_expect_success \
'git branch -d d/e/f should delete a branch and a log' \
@ -222,7 +222,7 @@ test_expect_success \
git checkout -b g/h/i -l master &&
test -f .git/refs/heads/g/h/i &&
test -f .git/logs/refs/heads/g/h/i &&
diff expect .git/logs/refs/heads/g/h/i'
test_cmp expect .git/logs/refs/heads/g/h/i'
test_expect_success 'avoid ambiguous track' '
git config branch.autosetupmerge true &&