提交 b5ff2cf9 编写于 作者: J Jakub Narebski 提交者: Junio C Hamano

gitweb: fix commitdiff for root commits

After changing all "-|" open invocations to list form, commitdiff for
initial commit (without parent) got broken; it returned incorrectly
empty patch earlier.  Use '--root' option to git-diff-tree for initial
(root) commit.

No checking for empty $hash_parent in git_commitdiff_plain -- we rely
on gitweb to give correct parameters for commitdiff_plain action.

Noticed by Matthias Lederhofer (matled).
Signed-off-by: NJakub Narebski <jnareb@gmail.com>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 bd943f47
......@@ -2109,7 +2109,7 @@ sub git_commitdiff {
die_error(undef, "Unknown commit object");
}
if (!defined $hash_parent) {
$hash_parent = $co{'parent'};
$hash_parent = $co{'parent'} || '--root';
}
open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
or die_error(undef, "Open git-diff-tree failed");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册