@matheusbsbs / matheus-bagliano / commits / 2ca8671470
Fork 0

--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>

Johan Herland committed Apr 12, 2011 at 11:24 UTC 2ca86714703f81f9dd5dfb31f8d97a8a0089634d
1 file changed +1 -1
diff.c
+1 -1
@@ -1541,7 +1541,7 @@ static void show_dirstat(struct diff_options *options)
1541 unsigned long copied, added, damage;
1542 int content_changed;
1543
1544 - name = p->one->path ? p->one->path : p->two->path;
1544 + name = p->two->path ? p->two->path : p->one->path;
1545
1546 if (p->one->sha1_valid && p->two->sha1_valid)
1547 content_changed = hashcmp(p->one->sha1, p->two->sha1);