aboutsummaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-02 16:29:56 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-04 00:19:29 -0700
commitb8ba1535bda7bd553f46ea57bdbcee1c90e500a0 (patch)
tree123d328a7225e8f118c68d1459bed82aaa01f7d5 /unpack-trees.c
parent2960a1d9eef846de9cfd9d6e32d203339d792120 (diff)
downloadgit-b8ba1535bda7bd553f46ea57bdbcee1c90e500a0.tar.gz
git-b8ba1535bda7bd553f46ea57bdbcee1c90e500a0.tar.xz
Fix twoway_merge that passed d/f conflict marker to merged_entry().
When switching from one tree to another, we should not send a marker that says "this file does not exist in the new tree -- I am a placeholder to tell you that, and not a real blob" down to merged_entry() as the result of the merge.
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 4cf83bd90..d0367846d 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -711,12 +711,18 @@ int twoway_merge(struct cache_entry **src,
struct unpack_trees_options *o)
{
struct cache_entry *current = src[0];
- struct cache_entry *oldtree = src[1], *newtree = src[2];
+ struct cache_entry *oldtree = src[1];
+ struct cache_entry *newtree = src[2];
if (o->merge_size != 2)
return error("Cannot do a twoway merge of %d trees",
o->merge_size);
+ if (oldtree == o->df_conflict_entry)
+ oldtree = NULL;
+ if (newtree == o->df_conflict_entry)
+ newtree = NULL;
+
if (current) {
if ((!oldtree && !newtree) || /* 4 and 5 */
(!oldtree && newtree &&
@@ -724,7 +730,7 @@ int twoway_merge(struct cache_entry **src,
(oldtree && newtree &&
same(oldtree, newtree)) || /* 14 and 15 */
(oldtree && newtree &&
- !same(oldtree, newtree) && /* 18 and 19*/
+ !same(oldtree, newtree) && /* 18 and 19 */
same(current, newtree))) {
return keep_entry(current, o);
}