]> git.ipfire.org Git - thirdparty/git.git/commit
merge-recursive: introduce new functions to handle rename logic
authorElijah Newren <newren@gmail.com>
Wed, 14 Feb 2018 18:51:50 +0000 (10:51 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Feb 2018 21:02:52 +0000 (13:02 -0800)
commit2dd6f8aa8495d30c9b16ed361c0b280bbed4bc14
tree56c5966f1590070dc09c42dd3f557a921a2b0bea
parenta706e8f6fc19c5f94108fd2253993b7e4e9b34d8
merge-recursive: introduce new functions to handle rename logic

The amount of logic in merge_trees() relative to renames was just a few
lines, but split it out into new handle_renames() and cleanup_renames()
functions to prepare for additional logic to be added to each.  No code or
logic changes, just a new place to put stuff for when the rename detection
gains additional checks.

Note that process_renames() records pointers to various information (such
as diff_filepairs) into rename_conflict_info structs.  Even though the
rename string_lists are not directly used once handle_renames() completes,
we should not immediately free the lists at the end of that function
because they store the information referenced in the rename_conflict_info,
which is used later in process_entry().  Thus the reason for a separate
cleanup_renames().

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c