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>
This commit is contained in:
Jakub Narebski 2006-11-18 23:35:38 +01:00 committed by Junio C Hamano
parent 69945602f9
commit 04408c3578

View File

@ -3731,7 +3731,8 @@ sub git_commitdiff {
$hash_parent, $hash, "--" $hash_parent, $hash, "--"
or die_error(undef, "Open git-diff-tree failed"); 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 # empty line ends raw part of diff-tree output
last unless $line; last unless $line;
push @difftree, $line; push @difftree, $line;