diff options
author | Elijah Newren <newren@gmail.com> | 2021-01-19 19:53:44 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-20 22:18:55 -0800 |
commit | 98d0d08128200e244a83d917b63567c30547c36d (patch) | |
tree | a00c3bfff604debb6036b09719f22096dd1e5a27 /t/t4211/sha1/expect.simple-main | |
parent | merge-ort: implement compute_rename_counts() (diff) | |
download | tgif-98d0d08128200e244a83d917b63567c30547c36d.tar.xz |
merge-ort: implement handle_directory_level_conflicts()
This is modelled on the version of handle_directory_level_conflicts()
from merge-recursive.c, but is massively simplified due to the following
factors:
* strmap API provides simplifications over using direct hashmap
* we have a dirs_removed field in struct rename_info that we have an
easy way to populate from collect_merge_info(); this was already
used in compute_rename_counts() and thus we do not need to check
for condition #2.
* The removal of condition #2 by handling it earlier in the code also
obviates the need to check for condition #3 -- if both sides renamed
a directory, meaning that the directory no longer exists on either
side, then neither side could have added any new files to that
directory, and thus there are no files whose locations we need to
move due to such a directory rename.
In fact, the same logic that makes condition #3 irrelevant means
condition #1 is also irrelevant so we could drop this function.
However, it is cheap to check if both sides rename the same directory,
and doing so can save future computation. So, simply remove any
directories that both sides renamed from the list of directory renames.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4211/sha1/expect.simple-main')
0 files changed, 0 insertions, 0 deletions