Thread (42 messages) flat view 42 messages, 3 authors, 2016-06-15
STALE3733d

[PATCH 4/3] --dirstat: In case of renames, use target filename instead of source filename

From: Johan Herland <hidden>
Date: 2016-06-15 22:51:01
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/diff.c b/diff.c
index 3e0bc1f..5376d01 100644
--- a/diff.c
+++ b/diff.c
@@ -1540,7 +1540,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);
-- 
1.7.5.rc1.3.g4d7b



-- 
Johan Herland, <johan@herland.net>
www.herland.net
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help