Skip to content

Commit 922d87f

Browse files
iabervongitster
authored andcommitted
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 <[email protected]>
1 parent e496c00 commit 922d87f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

t/t7201-co.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ test_expect_success "checkout with unrelated dirty tree without -m" '
8383
fill 0 1 2 3 4 5 6 7 8 >same &&
8484
cp same kept
8585
git checkout side >messages &&
86-
git diff same kept
86+
diff -u same kept
8787
(cat > messages.expect <<EOF
8888
M same
8989
EOF
9090
) &&
9191
touch messages.expect &&
92-
git diff messages.expect messages
92+
diff -u messages.expect messages
9393
'
9494

9595
test_expect_success "checkout -m with dirty tree" '
@@ -113,19 +113,19 @@ Auto-merged one
113113
M one
114114
EOF
115115
) &&
116-
git diff expect.messages messages &&
116+
diff -u expect.messages messages &&
117117
118118
fill "M one" "A three" "D two" >expect.master &&
119119
git diff --name-status master >current.master &&
120-
diff expect.master current.master &&
120+
diff -u expect.master current.master &&
121121
122122
fill "M one" >expect.side &&
123123
git diff --name-status side >current.side &&
124-
diff expect.side current.side &&
124+
diff -u expect.side current.side &&
125125
126126
: >expect.index &&
127127
git diff --cached >current.index &&
128-
diff expect.index current.index
128+
diff -u expect.index current.index
129129
'
130130

131131
test_expect_success "checkout -m with dirty tree, renamed" '
@@ -143,7 +143,7 @@ test_expect_success "checkout -m with dirty tree, renamed" '
143143
144144
git checkout -m renamer &&
145145
fill 1 3 4 5 7 8 >expect &&
146-
diff expect uno &&
146+
diff -u expect uno &&
147147
! test -f one &&
148148
git diff --cached >current &&
149149
! test -s current
@@ -168,7 +168,7 @@ test_expect_success 'checkout -m with merge conflict' '
168168
git diff master:one :3:uno |
169169
sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
170170
fill d2 aT d7 aS >expect &&
171-
diff current expect &&
171+
diff -u current expect &&
172172
git diff --cached two >current &&
173173
! test -s current
174174
'
@@ -185,7 +185,7 @@ If you want to create a new branch from this checkout, you may do so
185185
HEAD is now at 7329388... Initial A one, A two
186186
EOF
187187
) &&
188-
git diff messages.expect messages &&
188+
diff -u messages.expect messages &&
189189
H=$(git rev-parse --verify HEAD) &&
190190
M=$(git show-ref -s --verify refs/heads/master) &&
191191
test "z$H" = "z$M" &&

0 commit comments

Comments
 (0)