Skip to content

Commit 5ced7c3

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cf8937a commit 5ced7c3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

merge-ort.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,18 @@ static void get_provisional_directory_renames(struct merge_options *opt,
14391439
"no destination getting a majority of the "
14401440
"files."),
14411441
source_dir);
1442-
*clean = 0;
1442+
/*
1443+
* We should mark this as unclean IF something attempts
1444+
* to use this rename. We do not yet have the logic
1445+
* in place to detect if this directory rename is being
1446+
* used, and optimizations that reduce the number of
1447+
* renames cause this to falsely trigger. For now,
1448+
* just disable it, causing t6423 testcase 2a to break.
1449+
* We'll later fix the detection, and when we do we
1450+
* will re-enable setting *clean to 0 (and thereby fix
1451+
* t6423 testcase 2a).
1452+
*/
1453+
/* *clean = 0; */
14431454
} else {
14441455
strmap_put(&renames->dir_renames[side],
14451456
source_dir, (void*)best);

0 commit comments

Comments
 (0)