summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-24 00:51:22 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-24 00:58:13 (GMT)
commitd7ebd53d371153f7a61c0fe9f384c9662b751bf6 (patch)
tree08cd9a0e082f05c59109c3cbf029bd94488a1c2d /git-checkout.sh
parentc9a899256920b3266bb29f9d22bf6b9ab1b5a377 (diff)
downloadgit-d7ebd53d371153f7a61c0fe9f384c9662b751bf6.zip
git-d7ebd53d371153f7a61c0fe9f384c9662b751bf6.tar.gz
git-d7ebd53d371153f7a61c0fe9f384c9662b751bf6.tar.bz2
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 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh15
1 files changed, 5 insertions, 10 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index e02d4d8..c52f352 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -200,17 +200,12 @@ else
# Match the index to the working tree, and do a three-way.
git diff-files --name-only | git update-index --remove --stdin &&
work=`git write-tree` &&
- git read-tree --reset -u $new &&
- eval GITHEAD_$new=${new_name:-${branch:-$new}} GITHEAD_$work=local &&
- export GITHEAD_$new GITHEAD_$work &&
- git merge-recursive $old -- $new $work || exit
+ git read-tree --reset -u $new || exit
- if result=`git write-tree 2>/dev/null`
- then
- echo >&2 "Trivially automerged."
- else
- git merge-index -o git-merge-one-file -a
- fi
+ eval GITHEAD_$new=${new_name:-${branch:-$new}} &&
+ eval GITHEAD_$work=local &&
+ export GITHEAD_$new GITHEAD_$work &&
+ git merge-recursive $old -- $new $work
# Do not register the cleanly merged paths in the index yet.
# this is not a real merge before committing, but just carrying