]> git.ipfire.org Git - thirdparty/git.git/commit - merge-recursive.c
merge-recursive: restore accidentally dropped setting of path
authorElijah Newren <newren@gmail.com>
Tue, 4 Jun 2019 20:27:50 +0000 (13:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Jun 2019 16:30:40 +0000 (09:30 -0700)
commit481de8a293bfaa5425ea4dc5ac70aaf3081a3be8
tree195e0448307a7c9460641f50d73fe28385214c1d
parent8c8e5bd6eb331d055aa7fa6345f6dcdadd658979
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>
merge-recursive.c
t/t6042-merge-rename-corner-cases.sh