Skip to content

Commit 2ca8671

Browse files
jherlandgitster
authored andcommitted
--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 <[email protected]> Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2ff3a80 commit 2ca8671

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ static void show_dirstat(struct diff_options *options)
15411541
unsigned long copied, added, damage;
15421542
int content_changed;
15431543

1544-
name = p->one->path ? p->one->path : p->two->path;
1544+
name = p->two->path ? p->two->path : p->one->path;
15451545

15461546
if (p->one->sha1_valid && p->two->sha1_valid)
15471547
content_changed = hashcmp(p->one->sha1, p->two->sha1);

0 commit comments

Comments
 (0)