aboutsummaryrefslogtreecommitdiffstats
path: root/merge-ort.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-03-13 22:22:06 +0000
committerJunio C Hamano <gitster@pobox.com>2021-03-18 14:32:56 -0700
commitbf238b71377e924066ca5155a787c167177f706c (patch)
treeedecc467c8b8d4a34b43d029ef2645d0cf51012a /merge-ort.c
parent0491d39297132c48e36c2f73cb0dfe7e22b3c52f (diff)
downloadgit-bf238b71377e924066ca5155a787c167177f706c.tar.gz
diffcore-rename: add computation of number of unknown renames
The previous commit can only be effective if we have a computation of the number of paths under a given directory which are still have pending renames, and expected this number to be recorded in the dir_rename_count map under the key UNKNOWN_DIR. Add the code necessary to compute these values. Note that this change means dir_rename_count might have a directory whose only entry (for UNKNOWN_DIR) was removed by the time merge-ort goes to check it. To account for this, merge-ort needs to check for the case where the max count is 0. With this change we are now computing the necessary value for each directory in dirs_removed, but are not using that value anywhere. The next two commits will make use of the values stored in dirs_removed in order to compute whether each relevant_source (that is needed only for directory rename detection) has become unnecessary. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ort.c')
-rw-r--r--merge-ort.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/merge-ort.c b/merge-ort.c
index e2606c73ad..f2b259986e 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -1546,6 +1546,9 @@ static void get_provisional_directory_renames(struct merge_options *opt,
}
}
+ if (max == 0)
+ continue;
+
if (bad_max == max) {
path_msg(opt, source_dir, 0,
_("CONFLICT (directory rename split): "