Browse Source

gitweb: Protect against possible warning in git_commitdiff

We may read an undef from <$fd> and unconditionally chomping it
would result in a warning.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Jakub Narebski 18 years ago committed by Junio C Hamano
parent
commit
04408c3578
  1. 3
      gitweb/gitweb.perl

3
gitweb/gitweb.perl

@ -3731,7 +3731,8 @@ sub git_commitdiff { @@ -3731,7 +3731,8 @@ sub git_commitdiff {
$hash_parent, $hash, "--"
or die_error(undef, "Open git-diff-tree failed");

while (chomp(my $line = <$fd>)) {
while (my $line = <$fd>) {
chomp $line;
# empty line ends raw part of diff-tree output
last unless $line;
push @difftree, $line;

Loading…
Cancel
Save