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.
This commit is contained in:
parent
6ee67f2610
commit
a76d74fb71
@ -146,7 +146,7 @@ static void trivially_merge_cache(struct cache_entry **src, int nr)
|
|||||||
}
|
}
|
||||||
if (old && !path_matches(old, ce))
|
if (old && !path_matches(old, ce))
|
||||||
reject_merge(old);
|
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);
|
result->ce_flags |= htons(CE_UPDATE);
|
||||||
/*
|
/*
|
||||||
* See if we can re-use the old CE directly?
|
* 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;
|
old = NULL;
|
||||||
}
|
}
|
||||||
CHECK_OLD(ce);
|
CHECK_OLD(ce);
|
||||||
|
CHECK_OLD(src[0]);
|
||||||
CHECK_OLD(src[1]);
|
CHECK_OLD(src[1]);
|
||||||
CHECK_OLD(src[2]);
|
|
||||||
ce = result;
|
ce = result;
|
||||||
ce->ce_flags &= ~htons(CE_STAGEMASK);
|
ce->ce_flags &= ~htons(CE_STAGEMASK);
|
||||||
src += 2;
|
src += 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user