aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2006-08-06 16:14:25 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-06 13:41:49 -0700
commitb5ff2cf9a6a4246a5443e904acf3165e89654b1e (patch)
tree883e4a8cae2eda64cc12bb5523b2c3633d2c88e2 /gitweb
parentbd943f4757ab1d62d862ea12b4cf8b6b495e115f (diff)
downloadgit-b5ff2cf9a6a4246a5443e904acf3165e89654b1e.tar.gz
git-b5ff2cf9a6a4246a5443e904acf3165e89654b1e.tar.xz
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: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 5e72b4f61..9be35aebd 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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");