Skip to content

Commit

Permalink
--dirstat: In case of renames, use target filename instead of source …
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
jherland authored and gitster committed Apr 12, 2011
1 parent 2ff3a80 commit 2ca8671
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2ca8671

Please sign in to comment.