]> git.ipfire.org Git - thirdparty/git.git/commit - merge-recursive.c
merge-recursive: introduce new functions to handle rename logic
authorElijah Newren <newren@gmail.com>
Thu, 19 Apr 2018 17:58:00 +0000 (10:58 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Apr 2018 01:44:15 +0000 (10:44 +0900)
commitf172589e599fca939ab6bb5f2dae4d58f6d201fc
tree0bb29658339b0574eaab2075c4f4090962852a3f
parent9ba915577ff8bd0ef4677d7d6b5de857be52a108
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