From c3e7fbcbd0561cd13abc8cefcea3e09ab6090d50 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 21 May 2005 02:42:35 -0700 Subject: [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 Signed-off-by: Linus Torvalds --- diff-cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'diff-cache.c') diff --git a/diff-cache.c b/diff-cache.c index a5deb8c7a..b47b45a40 100644 --- a/diff-cache.c +++ b/diff-cache.c @@ -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); -- cgit v1.2.1