aboutsummaryrefslogtreecommitdiff
path: root/t/diff-lib.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-23 22:28:56 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-24 00:01:56 -0700
commit3af828634fa5bdbca1b2061a81df8b3fa73b0d34 (patch)
treef4d4a50e8c1686b3ecd796a09f98cc6ca13bc907 /t/diff-lib.sh
parent998b912927281a871e8d379e2b3a4385c775c4fe (diff)
downloadgit-3af828634fa5bdbca1b2061a81df8b3fa73b0d34.tar.gz
git-3af828634fa5bdbca1b2061a81df8b3fa73b0d34.tar.xz
tests: do not use implicit "git diff --no-index"
As a general principle, we should not use "git diff" to validate the results of what git command that is being tested has done. We would not know if we are testing the command in question, or locating a bug in the cute hack of "git diff --no-index". Rather use test_cmp for that purpose. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/diff-lib.sh')
-rw-r--r--t/diff-lib.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/diff-lib.sh b/t/diff-lib.sh
index 28b941c49..4bddeb591 100644
--- a/t/diff-lib.sh
+++ b/t/diff-lib.sh
@@ -11,7 +11,7 @@ compare_diff_raw () {
sed -e "$sanitize_diff_raw" <"$1" >.tmp-1
sed -e "$sanitize_diff_raw" <"$2" >.tmp-2
- git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
+ test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
}
sanitize_diff_raw_z='/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]*$/ X X \1#/'
@@ -23,7 +23,7 @@ compare_diff_raw_z () {
perl -pe 'y/\000/\012/' <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1
perl -pe 'y/\000/\012/' <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2
- git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
+ test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
}
compare_diff_patch () {
@@ -37,5 +37,5 @@ compare_diff_patch () {
/^[dis]*imilarity index [0-9]*%$/d
/^index [0-9a-f]*\.\.[0-9a-f]/d
' <"$2" >.tmp-2
- git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
+ test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
}