]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Protect against possible warning in git_commitdiff
authorJakub Narebski <redacted>
Sat, 18 Nov 2006 22:35:38 +0000 (23:35 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
We may read an undef from <$fd> and unconditionally chomping it
would result in a warning.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 8d15337b1a4a540f5ff3f6cc868067332209c256a2091327375dc0fc587d329f..aea8856a71c8990dbf2d1ada1cb93bf4deb8b836c2e6acd991a3ad103404c8ca 100755 (executable)
@@ -3732,7 +3732,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;
This page took 0.344276 seconds and 4 git commands to generate.