]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Fix "Use of uninitialized value" warning in git_tags_body
authorJakub Narebski <redacted>
Wed, 3 Jan 2007 21:54:29 +0000 (22:54 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
Fix "Use of uninitialized value" warning in git_tags_body generated
for lightweight tags of tree and blob object; those don't have age
($tag{'age'}) defined.

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

index 716d416b2291146ea1a4c263030d15ac172d44de4e1b9e39b4637ebf43fce3cf..e60709910728e62bc2c07e86dc78ef50a9a75add10dfe19ae47c1fc0523d2893 100755 (executable)
@@ -2814,8 +2814,12 @@ sub git_tags_body {
                        print "<tr class=\"light\">\n";
                }
                $alternate ^= 1;
-               print "<td><i>$tag{'age'}</i></td>\n" .
-                     "<td>" .
+               if (defined $tag{'age'}) {
+                       print "<td><i>$tag{'age'}</i></td>\n";
+               } else {
+                       print "<td></td>\n";
+               }
+               print "<td>" .
                      $cgi->a({-href => href(action=>$tag{'reftype'}, hash=>$tag{'refid'}),
                               -class => "list name"}, esc_html($tag{'name'})) .
                      "</td>\n" .
This page took 0.274302 seconds and 4 git commands to generate.