diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-10-11 13:38:11 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-03 23:25:13 -0800 |
commit | cee2d6ae6379e7c76e602d55ccc1d4babc1979c0 (patch) | |
tree | 5363e19452ffd7c5e86c7ea68a7bc1ffd2f6c93e /unpack-trees.c | |
parent | 1ee26571e97c64bccecfd26d1a1c1c631412a1b7 (diff) | |
download | git-cee2d6ae6379e7c76e602d55ccc1d4babc1979c0.tar.gz |
Aggressive three-way merge: fix D/F case
When the ancestor used to have a blob "P", your tree removed it, and the
tree you are merging with also removed it, the agressive three-way cleanly
merges to remove that blob. If the other tree added a new blob "P/Q"
while removing "P", it should also merge cleanly to remove "P" and create
"P/Q" (since neither the ancestor nor your tree could have had it, so it
is a typical "created in one").
The "aggressive" rule is not new anymore. Reword the stale comment.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index dd5999c356..7413ff0b93 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -767,7 +767,8 @@ int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o) remote = NULL; } - /* First, if there's a #16 situation, note that to prevent #13 + /* + * First, if there's a #16 situation, note that to prevent #13 * and #14. */ if (!same(remote, head)) { @@ -781,7 +782,8 @@ int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o) } } - /* We start with cases where the index is allowed to match + /* + * We start with cases where the index is allowed to match * something other than the head: #14(ALT) and #2ALT, where it * is permitted to match the result instead. */ @@ -811,12 +813,13 @@ int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o) if (!head && !remote && any_anc_missing) return 0; - /* Under the new "aggressive" rule, we resolve mostly trivial + /* + * Under the "aggressive" rule, we resolve mostly trivial * cases that we historically had git-merge-one-file resolve. */ if (o->aggressive) { - int head_deleted = !head && !df_conflict_head; - int remote_deleted = !remote && !df_conflict_remote; + int head_deleted = !head; + int remote_deleted = !remote; struct cache_entry *ce = NULL; if (index) |