]> git.ipfire.org Git - thirdparty/git.git/commit - diffcore-rename.c
diffcore-rename: extend cleanup_dir_rename_info()
authorElijah Newren <newren@gmail.com>
Sat, 27 Feb 2021 00:30:45 +0000 (00:30 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 27 Feb 2021 01:53:12 +0000 (17:53 -0800)
commitb1473019e8b2b4aafdf578ab3dade36c9c4d419d
tree6f96005bd5aac39aed3f0c1ecd321546f29a7f54
parentb6e3d2743410b0cfa749c1690de7f59683c0f372
diffcore-rename: extend cleanup_dir_rename_info()

When diffcore_rename_extended() is passed a NULL dir_rename_count, we
will still want to create a temporary one for use by
find_basename_matches(), but have it fully deallocated before
diffcore_rename_extended() returns.  However, when
diffcore_rename_extended() is passed a dir_rename_count, we want to fill
that strmap with appropriate values and return it.  However, for our
interim purposes we may also add entries corresponding to directories
that cannot have been renamed due to still existing on both sides.

Extend cleanup_dir_rename_info() to handle these two different cases,
cleaning up the relevant bits of information for each case.

Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-rename.c