@matheusbsbs / matheus-bagliano / commits / 922d87f92f
Fork 0

Use diff -u instead of diff in t7201

If the test failed, it was giving really unclear ed script output. Instead, give a diff that sort of suggests the problem. Also replaces the use of "git diff" for this purpose with "diff -u". Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>

Daniel Barkalow committed Feb 7, 2008 at 11:40 UTC 922d87f92f79d76ee1d9027d4a0f8a0cf36d5340
1 file changed +9 -9
t/t7201-co.sh
+9 -9
@@ -83,13 +83,13 @@ test_expect_success "checkout with unrelated dirty tree without -m" '
83 fill 0 1 2 3 4 5 6 7 8 >same &&
84 cp same kept
85 git checkout side >messages &&
86 - git diff same kept
86 + diff -u same kept
87 (cat > messages.expect <<EOF
88 M same
89 EOF
90 ) &&
91 touch messages.expect &&
92 - git diff messages.expect messages
92 + diff -u messages.expect messages
93 '
94
95 test_expect_success "checkout -m with dirty tree" '
@@ -113,19 +113,19 @@ Auto-merged one
113 M one
114 EOF
115 ) &&
116 - git diff expect.messages messages &&
116 + diff -u expect.messages messages &&
117
118 fill "M one" "A three" "D two" >expect.master &&
119 git diff --name-status master >current.master &&
120 - diff expect.master current.master &&
120 + diff -u expect.master current.master &&
121
122 fill "M one" >expect.side &&
123 git diff --name-status side >current.side &&
124 - diff expect.side current.side &&
124 + diff -u expect.side current.side &&
125
126 : >expect.index &&
127 git diff --cached >current.index &&
128 - diff expect.index current.index
128 + diff -u expect.index current.index
129 '
130
131 test_expect_success "checkout -m with dirty tree, renamed" '
@@ -143,7 +143,7 @@ test_expect_success "checkout -m with dirty tree, renamed" '
143
144 git checkout -m renamer &&
145 fill 1 3 4 5 7 8 >expect &&
146 - diff expect uno &&
146 + diff -u expect uno &&
147 ! test -f one &&
148 git diff --cached >current &&
149 ! test -s current
@@ -168,7 +168,7 @@ test_expect_success 'checkout -m with merge conflict' '
168 git diff master:one :3:uno |
169 sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
170 fill d2 aT d7 aS >expect &&
171 - diff current expect &&
171 + diff -u current expect &&
172 git diff --cached two >current &&
173 ! test -s current
174 '
@@ -185,7 +185,7 @@ If you want to create a new branch from this checkout, you may do so
185 HEAD is now at 7329388... Initial A one, A two
186 EOF
187 ) &&
188 - git diff messages.expect messages &&
188 + diff -u messages.expect messages &&
189 H=$(git rev-parse --verify HEAD) &&
190 M=$(git show-ref -s --verify refs/heads/master) &&
191 test "z$H" = "z$M" &&