diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-05-03 14:08:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-03 14:08:12 -0700 |
commit | 10b8084ee1be90227dff570fee8a57d183e7ae07 (patch) | |
tree | 0f9ec14826b2bb775183faa7fc479b2c17a9c00e | |
parent | ee88674f24151fe5c6cd6ccd3c1a6cd972b2adc0 (diff) | |
parent | 8e1b62f174bb53f5fb7cf027f9c426d0c6864003 (diff) | |
download | git-10b8084ee1be90227dff570fee8a57d183e7ae07.tar.gz git-10b8084ee1be90227dff570fee8a57d183e7ae07.tar.xz |
Merge branch 'en/merge-fixes'
"merge-recursive" strategy incorrectly checked if a path that is
involved in its internal merge exists in the working tree.
* en/merge-fixes:
merge-recursive: do not check working copy when creating a virtual merge base
merge-recursive: remove duplicate code
-rw-r--r-- | merge-recursive.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index b880ae50e..06d31ed87 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -622,7 +622,7 @@ static char *unique_path(struct merge_options *o, const char *path, const char * base_len = newpath.len; while (string_list_has_string(&o->current_file_set, newpath.buf) || string_list_has_string(&o->current_directory_set, newpath.buf) || - file_exists(newpath.buf)) { + (!o->call_depth && file_exists(newpath.buf))) { strbuf_setlen(&newpath, base_len); strbuf_addf(&newpath, "_%d", suffix++); } @@ -1234,8 +1234,8 @@ static void conflict_rename_rename_2to1(struct merge_options *o, a->path, c1->path, ci->branch1, b->path, c2->path, ci->branch2); - remove_file(o, 1, a->path, would_lose_untracked(a->path)); - remove_file(o, 1, b->path, would_lose_untracked(b->path)); + remove_file(o, 1, a->path, o->call_depth || would_lose_untracked(a->path)); + remove_file(o, 1, b->path, o->call_depth || would_lose_untracked(b->path)); mfi_c1 = merge_file_special_markers(o, a, c1, &ci->ren1_other, o->branch1, c1->path, @@ -1773,8 +1773,6 @@ static int process_entry(struct merge_options *o, output(o, 1, _("CONFLICT (%s): There is a directory with name %s in %s. " "Adding %s as %s"), conf, path, other_branch, path, new_path); - if (o->call_depth) - remove_file_from_cache(path); update_file(o, 0, sha, mode, new_path); if (o->call_depth) remove_file_from_cache(path); |