mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
95508a0751
commit
2f69de5b4b
@ -73,33 +73,12 @@ test_expect_success 'merge white into red (A->B,M->N)' \
|
||||
'
|
||||
git checkout -b red-white red &&
|
||||
git merge white &&
|
||||
git write-tree >/dev/null || {
|
||||
echo "BAD: merge did not complete"
|
||||
return 1
|
||||
}
|
||||
|
||||
test -f B || {
|
||||
echo "BAD: B does not exist in working directory"
|
||||
return 1
|
||||
}
|
||||
test -f N || {
|
||||
echo "BAD: N does not exist in working directory"
|
||||
return 1
|
||||
}
|
||||
test -f R || {
|
||||
echo "BAD: R does not exist in working directory"
|
||||
return 1
|
||||
}
|
||||
|
||||
test -f A && {
|
||||
echo "BAD: A still exists in working directory"
|
||||
return 1
|
||||
}
|
||||
test -f M && {
|
||||
echo "BAD: M still exists in working directory"
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
git write-tree &&
|
||||
test_path_is_file B &&
|
||||
test_path_is_file N &&
|
||||
test_path_is_file R &&
|
||||
test_path_is_missing A &&
|
||||
test_path_is_missing M
|
||||
'
|
||||
|
||||
# This test broke in 8371234ecaaf6e14fe3f2082a855eff1bbd79ae9
|
||||
@ -108,32 +87,13 @@ test_expect_success 'merge blue into white (A->B, mod A, A untracked)' \
|
||||
git checkout -b white-blue white &&
|
||||
echo dirty >A &&
|
||||
git merge blue &&
|
||||
git write-tree >/dev/null || {
|
||||
echo "BAD: merge did not complete"
|
||||
return 1
|
||||
}
|
||||
|
||||
test -f A || {
|
||||
echo "BAD: A does not exist in working directory"
|
||||
return 1
|
||||
}
|
||||
test `cat A` = dirty || {
|
||||
echo "BAD: A content is wrong"
|
||||
return 1
|
||||
}
|
||||
test -f B || {
|
||||
echo "BAD: B does not exist in working directory"
|
||||
return 1
|
||||
}
|
||||
test -f N || {
|
||||
echo "BAD: N does not exist in working directory"
|
||||
return 1
|
||||
}
|
||||
test -f M && {
|
||||
echo "BAD: M still exists in working directory"
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
git write-tree &&
|
||||
test_path_is_file A &&
|
||||
echo dirty >expect &&
|
||||
test_cmp expect A &&
|
||||
test_path_is_file B &&
|
||||
test_path_is_file N &&
|
||||
test_path_is_missing M
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user