[PATCH] Diff overhaul, adding the other half of copy detection.

This patch extends diff-cache and diff-files to report the
unmodified files to diff-core as well when -C (copy detection)
is in effect, so that the unmodified files can also be used as
the source candidates.  The existing test t4003 has been
extended to cover this case.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Junio C Hamano
2005-05-21 02:42:35 -07:00
committed by Linus Torvalds
parent 52e9578985
commit c3e7fbcbd0
3 changed files with 40 additions and 3 deletions

View File

@ -71,7 +71,8 @@ static int show_modified(struct cache_entry *old,
}
oldmode = old->ce_mode;
if (mode == oldmode && !memcmp(sha1, old->sha1, 20))
if (mode == oldmode && !memcmp(sha1, old->sha1, 20) &&
detect_rename < 2)
return 0;
mode = ntohl(mode);