1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-05 13:16:09 +02:00

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>
This commit is contained in:
Jakub Narebski 2007-05-19 02:47:51 +02:00 committed by Junio C Hamano
parent c0e9892637
commit c906b18122

View File

@ -5040,7 +5040,8 @@ sub git_feed {
# 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