summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-02-05 14:54:12 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-02-05 14:54:12 -0800
commit15f409643e5d40f441227c6cd75e9803a8b6b871 (patch)
tree79ee4267839afd0242cd820680d7e48ef166e33a
parentMerge branch 'js/fopen-harder' into maint (diff)
parentgitweb: squelch "uninitialized value" warning (diff)
downloadtgif-15f409643e5d40f441227c6cd75e9803a8b6b871.tar.xz
Merge branch 'ho/gitweb-squelch-undef-warning' into maint
Asking gitweb for a nonexistent commit left a warning in the server log. Somebody may want to follow this up with a new test, perhaps? IIRC, we do test that no Perl warnings are given to the server log, so this should have been caught if our test coverage were good. * ho/gitweb-squelch-undef-warning: gitweb: squelch "uninitialized value" warning
-rwxr-xr-xgitweb/gitweb.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7a5b23acf2..05d7910b7c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -7576,7 +7576,7 @@ sub git_object {
git_cmd(), 'cat-file', '-t', $object_id) . ' 2> /dev/null'
or die_error(404, "Object does not exist");
$type = <$fd>;
- chomp $type;
+ defined $type && chomp $type;
close $fd
or die_error(404, "Object does not exist");