1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-10 03:46:08 +02:00

merge-ort: ignore the directory rename split conflict for now

get_provisional_directory_renames() has code to detect directories being
evenly split between different locations.  However, as noted previously,
if there are no new files added to that directory that was split evenly,
our inability to determine where the directory was renamed to doesn't
matter since there are no new files to try to move into the new
location.  Unfortunately, that code is unaware of whether there are new
files under the directory in question and we just ignore that, causing
us to fail t6423 test 2b but pass test 2a; turn off the error for now,
swapping which tests pass and fail.

The motivating reason for switching this off as a temporary measure is
that as we add optimizations, we'll start looking at only subsets of
renames, and subsets of renames can start switching the result we get
when this error is (wrongly) on.  Once we get enough optimizations,
however, we can prevent that code from even running when there are no
new files added to the relevant directory, at which point we can revert
this commit and then both testcases 2a and 2b will pass simultaneously.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren 2021-01-23 22:01:11 -08:00 committed by Junio C Hamano
parent cf8937acde
commit 5ced7c3da0

View File

@ -1439,7 +1439,18 @@ static void get_provisional_directory_renames(struct merge_options *opt,
"no destination getting a majority of the "
"files."),
source_dir);
*clean = 0;
/*
* We should mark this as unclean IF something attempts
* to use this rename. We do not yet have the logic
* in place to detect if this directory rename is being
* used, and optimizations that reduce the number of
* renames cause this to falsely trigger. For now,
* just disable it, causing t6423 testcase 2a to break.
* We'll later fix the detection, and when we do we
* will re-enable setting *clean to 0 (and thereby fix
* t6423 testcase 2a).
*/
/* *clean = 0; */
} else {
strmap_put(&renames->dir_renames[side],
source_dir, (void*)best);