summaryrefslogtreecommitdiff
path: root/diff-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-21 09:42:35 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-21 16:58:03 (GMT)
commitc3e7fbcbd0561cd13abc8cefcea3e09ab6090d50 (patch)
treeee4065e9e7607efef9451ee696be44333496bccc /diff-cache.c
parent52e9578985fb636ec1d3f6cf794fdadd5ec896fc (diff)
downloadgit-c3e7fbcbd0561cd13abc8cefcea3e09ab6090d50.zip
git-c3e7fbcbd0561cd13abc8cefcea3e09ab6090d50.tar.gz
git-c3e7fbcbd0561cd13abc8cefcea3e09ab6090d50.tar.bz2
[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>
Diffstat (limited to 'diff-cache.c')
-rw-r--r--diff-cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/diff-cache.c b/diff-cache.c
index a5deb8c..b47b45a 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);