summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2010-09-20 02:29:04 -0600
committerJunio C Hamano <gitster@pobox.com>2010-09-29 17:37:04 -0700
commit71f7ffcc02a2f38436c59146b86897389130a538 (patch)
treee28a7efbfae0ced88c94362c854e91ff443afb55 /merge-recursive.c
parent882fd11aff6f0e8add77e75924678cce875a0eaf (diff)
downloadgit-71f7ffcc02a2f38436c59146b86897389130a538.tar.gz
merge-recursive: Delay modify/delete conflicts if D/F conflict present
When handling merges with modify/delete conflicts, if the modified path is involved in a D/F conflict, handle the issue in process_df_entry() rather than process_entry(). Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 0ca54bd882..ffcecc7f49 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1249,6 +1249,10 @@ static int process_entry(struct merge_options *o,
output(o, 2, "Removing %s", path);
/* do not touch working file if it did not exist */
remove_file(o, 1, path, !a_sha);
+ } else if (string_list_has_string(&o->current_directory_set,
+ path)) {
+ entry->processed = 0;
+ return 1; /* Assume clean till processed */
} else {
/* Deleted in one and changed in the other */
clean_merge = 0;
@@ -1367,6 +1371,11 @@ static int process_df_entry(struct merge_options *o,
entry->processed = 0;
break;
}
+ } else if (o_sha && (!a_sha || !b_sha)) {
+ /* Modify/delete; deleted side may have put a directory in the way */
+ clean_merge = 0;
+ handle_delete_modify(o, path,
+ a_sha, a_mode, b_sha, b_mode);
} else if (!o_sha && !!a_sha != !!b_sha) {
/* directory -> (directory, file) */
const char *add_branch;