From: Jakub Narebski Date: Sat, 19 May 2007 00:47:51 +0000 (+0200) Subject: gitweb: Fix "Use of uninitialized value" warning in git_feed X-Git-Tag: v1.5.2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c906b18122af72a8219c76281473490f812e5a40;p=git.git 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 --- 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