Skip to content

Commit 2f69de5

Browse files
peffgitster
authored andcommitted
t6034: use modern test_* helpers
These say roughly the same thing as the hand-rolled messages. We do lose the "merge did not complete" debug message, but merge and write-tree are prefectly capable of writing useful error messages when they fail. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 95508a0 commit 2f69de5

File tree

1 file changed

+13
-53
lines changed

1 file changed

+13
-53
lines changed

t/t6034-merge-rename-nocruft.sh

Lines changed: 13 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -73,33 +73,12 @@ test_expect_success 'merge white into red (A->B,M->N)' \
7373
'
7474
git checkout -b red-white red &&
7575
git merge white &&
76-
git write-tree >/dev/null || {
77-
echo "BAD: merge did not complete"
78-
return 1
79-
}
80-
81-
test -f B || {
82-
echo "BAD: B does not exist in working directory"
83-
return 1
84-
}
85-
test -f N || {
86-
echo "BAD: N does not exist in working directory"
87-
return 1
88-
}
89-
test -f R || {
90-
echo "BAD: R does not exist in working directory"
91-
return 1
92-
}
93-
94-
test -f A && {
95-
echo "BAD: A still exists in working directory"
96-
return 1
97-
}
98-
test -f M && {
99-
echo "BAD: M still exists in working directory"
100-
return 1
101-
}
102-
return 0
76+
git write-tree &&
77+
test_path_is_file B &&
78+
test_path_is_file N &&
79+
test_path_is_file R &&
80+
test_path_is_missing A &&
81+
test_path_is_missing M
10382
'
10483

10584
# This test broke in 8371234ecaaf6e14fe3f2082a855eff1bbd79ae9
@@ -108,32 +87,13 @@ test_expect_success 'merge blue into white (A->B, mod A, A untracked)' \
10887
git checkout -b white-blue white &&
10988
echo dirty >A &&
11089
git merge blue &&
111-
git write-tree >/dev/null || {
112-
echo "BAD: merge did not complete"
113-
return 1
114-
}
115-
116-
test -f A || {
117-
echo "BAD: A does not exist in working directory"
118-
return 1
119-
}
120-
test `cat A` = dirty || {
121-
echo "BAD: A content is wrong"
122-
return 1
123-
}
124-
test -f B || {
125-
echo "BAD: B does not exist in working directory"
126-
return 1
127-
}
128-
test -f N || {
129-
echo "BAD: N does not exist in working directory"
130-
return 1
131-
}
132-
test -f M && {
133-
echo "BAD: M still exists in working directory"
134-
return 1
135-
}
136-
return 0
90+
git write-tree &&
91+
test_path_is_file A &&
92+
echo dirty >expect &&
93+
test_cmp expect A &&
94+
test_path_is_file B &&
95+
test_path_is_file N &&
96+
test_path_is_missing M
13797
'
13898

13999
test_done

0 commit comments

Comments
 (0)