]> git.ipfire.org Git - thirdparty/git.git/commit - diffcore-rename.c
diffcore-rename: split locate_rename_dst into two functions
authorJeff King <peff@peff.net>
Fri, 27 Feb 2015 01:39:48 +0000 (20:39 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Feb 2015 21:41:21 +0000 (13:41 -0800)
commitf98c2f7e53062a59f67914337c0b45c82393e11f
tree7236356f1c027456bb51f4f4d5be4c7c8374a84e
parent282616c72d1d08a77ca4fe1186cb708c38408d87
diffcore-rename: split locate_rename_dst into two functions

This function manages the mapping of destination pathnames
to filepairs, and it handles both insertion and lookup. This
makes the return value a bit confusing, as we return a newly
created entry (even though no caller cares), and have no
room to indicate to the caller that an entry already
existed.

Instead, let's break this up into two distinct functions,
both backed by a common binary search. The binary search
will use our normal "return the index if we found something,
or negative index minus one to show where it would have
gone" semantics.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-rename.c