]> git.ipfire.org Git - thirdparty/git.git/commit - merge-ort.c
diffcore-rename: add computation of number of unknown renames
authorElijah Newren <newren@gmail.com>
Sat, 13 Mar 2021 22:22:06 +0000 (22:22 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Mar 2021 21:32:56 +0000 (14:32 -0700)
commitbf238b71377e924066ca5155a787c167177f706c
treeedecc467c8b8d4a34b43d029ef2645d0cf51012a
parent0491d39297132c48e36c2f73cb0dfe7e22b3c52f
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>
diffcore-rename.c
merge-ort.c