All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gitweb: Fix "Use of uninitialized value" warning in git_feed
@ 2007-05-19  0:47 Jakub Narebski
  2007-05-19  1:45 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Narebski @ 2007-05-19  0:47 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Initial (root) commit has no parents, and $co{'parent'} is
undefined. Use '--root' for initial commit.

This fixes "Use of uninitialized value in open at gitweb/gitweb.perl
line 4925." warning.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index fa8cc02..091cf9c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4923,7 +4923,8 @@ XML
 
 		# get list of changed files
 		open my $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
-			$co{'parent'}, $co{'id'}, "--", (defined $file_name ? $file_name : ())
+			$co{'parent'} || "--root",
+			$co{'id'}, "--", (defined $file_name ? $file_name : ())
 			or next;
 		my @difftree = map { chomp; $_ } <$fd>;
 		close $fd
-- 
1.5.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-19  2:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-19  0:47 [PATCH] gitweb: Fix "Use of uninitialized value" warning in git_feed Jakub Narebski
2007-05-19  1:45 ` Junio C Hamano
2007-05-19  2:08   ` Jakub Narebski
2007-05-19  2:49     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.