summaryrefslogtreecommitdiff
path: root/read-tree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-05 23:32:53 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-05 23:32:53 -0700
commita76d74fb7146d1785cdefc58a91c50ab9acec775 (patch)
tree12023d513724ec1d3b4f2faddb4206b48afa2a2b /read-tree.c
parent6ee67f2610d0060bee45eee0b83fe42143441589 (diff)
downloadgit-a76d74fb7146d1785cdefc58a91c50ab9acec775.tar.gz
Three-way merge: fix silly bug that made trivial merges not work
Making the main loop look more like the one- and two-way cases introduced a bug where "src" had been updated early, but later users hadn't been adjusted to match.
Diffstat (limited to 'read-tree.c')
-rw-r--r--read-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/read-tree.c b/read-tree.c
index 8c9ffe1232..b72ee1c54c 100644
--- a/read-tree.c
+++ b/read-tree.c
@@ -146,7 +146,7 @@ static void trivially_merge_cache(struct cache_entry **src, int nr)
}
if (old && !path_matches(old, ce))
reject_merge(old);
- if (nr > 2 && (result = merge_entries(ce, src[1], src[2])) != NULL) {
+ if (nr > 2 && (result = merge_entries(ce, src[0], src[1])) != NULL) {
result->ce_flags |= htons(CE_UPDATE);
/*
* See if we can re-use the old CE directly?
@@ -160,8 +160,8 @@ static void trivially_merge_cache(struct cache_entry **src, int nr)
old = NULL;
}
CHECK_OLD(ce);
+ CHECK_OLD(src[0]);
CHECK_OLD(src[1]);
- CHECK_OLD(src[2]);
ce = result;
ce->ce_flags &= ~htons(CE_STAGEMASK);
src += 2;