aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2011-04-12 11:24:34 +0200
committerJunio C Hamano <gitster@pobox.com>2011-04-12 11:29:34 -0700
commit2ca86714703f81f9dd5dfb31f8d97a8a0089634d (patch)
tree03e96bbf2b7fafaa57b6ff9dad2346b518a26fca /diff.c
parent2ff3a80334115797b8446909655e536f43900bc5 (diff)
downloadgit-2ca86714703f81f9dd5dfb31f8d97a8a0089634d.tar.gz
git-2ca86714703f81f9dd5dfb31f8d97a8a0089634d.tar.xz
--dirstat: In case of renames, use target filename instead of source filename
This changes --dirstat analysis to count "damage" toward the target filename, rather than the source filename. For renames within a directory, this won't matter to the final output, but when moving files between diretories, the output now lists the target directory rather than the source directory. Signed-off-by: Johan Herland <johan@herland.net> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 1f44cb423..abd9cd5f3 100644
--- a/diff.c
+++ b/diff.c
@@ -1541,7 +1541,7 @@ static void show_dirstat(struct diff_options *options)
unsigned long copied, added, damage;
int content_changed;
- name = p->one->path ? p->one->path : p->two->path;
+ name = p->two->path ? p->two->path : p->one->path;
if (p->one->sha1_valid && p->two->sha1_valid)
content_changed = hashcmp(p->one->sha1, p->two->sha1);