path: root/t/
diff options
authorJunio C Hamano <>2008-05-24 05:28:56 (GMT)
committerJunio C Hamano <>2008-05-24 07:01:56 (GMT)
commit3af828634fa5bdbca1b2061a81df8b3fa73b0d34 (patch)
treef4d4a50e8c1686b3ecd796a09f98cc6ca13bc907 /t/
parent998b912927281a871e8d379e2b3a4385c775c4fe (diff)
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 <>
Diffstat (limited to 't/')
1 files changed, 3 insertions, 3 deletions
diff --git a/t/ b/t/
index 3cbfee7..85d7e3e 100755
--- a/t/
+++ b/t/
@@ -101,7 +101,7 @@ cat > expect << EOF
git rerere diff > out
-test_expect_success 'rerere diff' 'git diff expect out'
+test_expect_success 'rerere diff' 'test_cmp expect out'
cat > expect << EOF
@@ -109,7 +109,7 @@ EOF
git rerere status > out
-test_expect_success 'rerere status' 'git diff expect out'
+test_expect_success 'rerere status' 'test_cmp expect out'
test_expect_success 'commit succeeds' \
"git commit -q -a -m 'prefer first over second'"
@@ -126,7 +126,7 @@ test_expect_success 'another conflicting merge' '
git show first:a1 | sed 's/To die: t/To die! T/' > expect
test_expect_success 'rerere kicked in' "! grep ======= a1"
-test_expect_success 'rerere prefers first change' 'git diff a1 expect'
+test_expect_success 'rerere prefers first change' 'test_cmp a1 expect'
rm $rr/postimage
echo "$sha1 a1" | perl -pe 'y/\012/\000/' > .git/rr-cache/MERGE_RR