aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2007-05-19 02:47:51 +0200
committerJunio C Hamano <junkio@cox.net>2007-05-18 19:49:45 -0700
commitc906b18122af72a8219c76281473490f812e5a40 (patch)
tree5d521f8fc930b4b7526c8e867819b6b057c1a518
parentc0e9892637e8144f10f2c408e276a470520f3601 (diff)
downloadgit-c906b18122af72a8219c76281473490f812e5a40.tar.gz
git-c906b18122af72a8219c76281473490f812e5a40.tar.xz
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 <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 2 insertions, 1 deletions
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