merge-recursive: add get_directory_renames()
authorElijah Newren <newren@gmail.com>
Thu, 19 Apr 2018 17:58:05 +0000 (10:58 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 May 2018 07:11:00 +0000 (16:11 +0900)
commit7fe40b88efc721bfcbe69f00f950eb9f7a9cd236
tree3a2883c0f0693231dbf2a5f92559076b3438401d
parentffc16c490ad533bc07e6d8ec0226b426166e8442
merge-recursive: add get_directory_renames()

This populates a set of directory renames for us.  The set of directory
renames is not yet used, but will be in subsequent commits.

Note that the use of a string_list for possible_new_dirs in the new
dir_rename_entry struct implies an O(n^2) algorithm; however, in practice
I expect the number of distinct directories that files were renamed into
from a single original directory to be O(1).  My guess is that n has a
mode of 1 and a mean of less than 2, so, for now, string_list seems good
enough for possible_new_dirs.

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
merge-recursive.h