diff options
author | Elijah Newren <newren@gmail.com> | 2019-06-04 13:27:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-05 09:30:40 -0700 |
commit | 481de8a293bfaa5425ea4dc5ac70aaf3081a3be8 (patch) | |
tree | 195e0448307a7c9460641f50d73fe28385214c1d /merge-recursive.c | |
parent | merge-recursive: switch directory rename detection default (diff) | |
download | tgif-481de8a293bfaa5425ea4dc5ac70aaf3081a3be8.tar.xz |
merge-recursive: restore accidentally dropped setting of path
In commit 8daec1df03de ("merge-recursive: switch from (oid,mode) pairs
to a diff_filespec", 2019-04-05), we actually switched from
(oid,mode,path) triplets to a diff_filespec -- but most callsites in the
patch only needed to worry about oid and mode so the commit message
focused on that. The oversight in the commit message apparently spilled
over to the code as well; one of the dozen or so callsites accidentally
dropped the setting of the path in the conversion. Restore the path
setting in that location.
Also, this pointed out that our testsuite was lacking a good rename/add
test, at least one that involved the need for merge content with the
rename. Add such a test, and since rename/add vs. add/rename could
possibly be important, redo the merge the opposite direction to make
sure we don't have issues with the direction of the merge. These
testcases failed before restoring the setting of path, but with the
paths appropriately set the testcases both pass.
Reported-by: Ben Humphreys <behumphreys@atlassian.com>
Based-on-patch-by: SZEDER Gábor <szeder.dev@gmail.com>
Tested-by: Ben Humphreys <behumphreys@atlassian.com>
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index 36af441faa..917b9229eb 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1655,6 +1655,7 @@ static int handle_rename_add(struct merge_options *opt, c->path, add_branch); prev_path_desc = xstrfmt("version of %s from %s", path, a->path); + ci->ren1->src_entry->stages[other_stage].path = a->path; if (merge_mode_and_contents(opt, a, c, &ci->ren1->src_entry->stages[other_stage], prev_path_desc, |