* [PATCH] gitweb: fix commitdiff for root commits
@ 2006-08-06 14:14 Jakub Narebski
0 siblings, 0 replies; only message in thread
From: Jakub Narebski @ 2006-08-06 14:14 UTC (permalink / raw)
To: git, Matthias Lederhofer
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>
---
Patch based on 'next' branch (234416bff6c426a9abaaacef80ba3679c0ce8f39)
gitweb/gitweb.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d0672cd..bbea21a 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");
--
1.4.1.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-08-06 14:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-06 14:14 [PATCH] gitweb: fix commitdiff for root commits Jakub Narebski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).