summaryrefslogtreecommitdiff
path: root/t/t7201-co.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-23 16:51:22 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-23 16:58:13 -0800
commitd7ebd53d371153f7a61c0fe9f384c9662b751bf6 (patch)
tree08cd9a0e082f05c59109c3cbf029bd94488a1c2d /t/t7201-co.sh
parentc9a899256920b3266bb29f9d22bf6b9ab1b5a377 (diff)
downloadgit-d7ebd53d371153f7a61c0fe9f384c9662b751bf6.tar.gz
git-checkout -m: fix merge case
Commit c1a4278e switched the "merging checkout" implementation from 3-way read-tree to merge-recursive, but forgot that merge-recursive will signal an unmerged state with its own exit status code. This prevented the clean-up phase (paths cleanly merged should not be updated in the index) from running. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t7201-co.sh')
-rwxr-xr-xt/t7201-co.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 315fa3564c..867bbd26cb 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -100,7 +100,33 @@ test_expect_success "checkout -m with dirty tree, renamed" '
git checkout -m renamer &&
fill 1 3 4 5 7 8 >expect &&
diff expect uno &&
- ! test -f one
+ ! test -f one &&
+ git diff --cached >current &&
+ ! test -s current
+
+'
+
+test_expect_success 'checkout -m with merge conflict' '
+
+ git checkout -f master && git clean &&
+
+ fill 1 T 3 4 5 6 S 8 >one &&
+ if git checkout renamer
+ then
+ echo Not happy
+ false
+ else
+ echo "happy - failed correctly"
+ fi &&
+
+ git checkout -m renamer &&
+
+ git diff master:one :3:uno |
+ sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
+ fill d2 aT d7 aS >expect &&
+ diff current expect &&
+ git diff --cached two >current &&
+ ! test -s current
'
test_done