summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e349d21)
raw | patch | inline | side by side (parent: e349d21)
author | Matthias Lederhofer <matled@gmx.net> | |
Sun, 6 Aug 2006 17:24:47 +0000 (19:24 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 6 Aug 2006 20:42:41 +0000 (13:42 -0700) |
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b8e266e0d9b49e834a4f35d25a407ecb03aa6026..08de2ce77ea12e40078b816001da15c466e79d17 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
sub git_commitdiff_plain {
mkdir($git_temp, 0700);
+ my %co = git_read_commit($hash);
+ if (!%co) {
+ die_error(undef, "Unknown commit object");
+ }
+ if (!defined $hash_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");
my @difftree = map { chomp; $_ } <$fd>;
}
print $cgi->header(-type => "text/plain", -charset => 'utf-8', '-content-disposition' => "inline; filename=\"git-$hash.patch\"");
- my %co = git_read_commit($hash);
my %ad = date_str($co{'author_epoch'}, $co{'author_tz'});
my $comment = $co{'comment'};
print "From: $co{'author'}\n" .