diff options
author | Elijah Newren <newren@gmail.com> | 2021-01-19 19:53:53 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-20 22:18:55 -0800 |
commit | 203c872c4f29e08867d572eca4f18cd1f39f9e4b (patch) | |
tree | a4d408d9415b3b28aab924caa94d9b838d7700b1 /t/t4117-apply-reject.sh | |
parent | merge-ort: process_renames() now needs more defensiveness (diff) | |
download | tgif-203c872c4f29e08867d572eca4f18cd1f39f9e4b.tar.xz |
merge-ort: fix a directory rename detection bug
As noted in commit 902c521a35 ("t6423: more involved directory rename
test", 2020-10-15), when we have a case where
* dir/subdir/ has several files
* almost all files in dir/subdir/ are renamed to folder/subdir/
* one of the files in dir/subdir/ is renamed to folder/subdir/newsubdir/
* the other side of history (that doesn't do the renames) adds a
new file to dir/subdir/
Then for the majority of the file renames, the directory rename of
dir/subdir/ -> folder/subdir/
is actually not represented that way but as
dir/ -> folder/
We also had one rename that was represented as
dir/subdir/ -> folder/subdir/newsubdir/
Now, since there's a new file in dir/subdir/, where does it go? Well,
there's only one rule for dir/subdir/, so the code previously noted that
this rule had the "majority" of the one "relevant" rename and thus
erroneously used it to place the file in folder/subdir/newsubdir/. We
really want the heavy weight associated with dir/ -> folder/ to also be
treated as dir/subdir/ -> folder/subdir/, so that we correctly place the
file in folder/subdir/.
Add a bunch of logic to make sure that we use all relevant renamings in
directory rename detection.
Note that testcase 12f of t6423 still fails after this, but it gets
further than merge-recursive does. There are some performance related
bits in that testcase (the region_enter messages) that do not yet
succeed, but the rest of the testcase works after this patch.
Subsequent patch series will fix up the performance side.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4117-apply-reject.sh')
0 files changed, 0 insertions, 0 deletions