提交 2ca86714 编写于 作者: J Johan Herland 提交者: Junio C Hamano

--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: NJohan Herland <johan@herland.net>
Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 2ff3a803
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册