From c906b18122af72a8219c76281473490f812e5a40 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sat, 19 May 2007 02:47:51 +0200 Subject: [PATCH] gitweb: Fix "Use of uninitialized value" warning in git_feed 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 Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 17d8efb29..5c7011a37 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5040,7 +5040,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 -- 2.30.2