@matheusbsbs / matheus-bagliano / commits / 27dd1a83cb
Fork 0

gitweb: Fix "Use of uninitialized value" warning in git_tags_body

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 <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Jan 3, 2007 at 22:54 UTC 27dd1a83cbedb65d7116814ef2c0bf9d4986c8f5
1 file changed +6 -2
gitweb/gitweb.perl
+6 -2
@@ -2813,8 +2813,12 @@ sub git_tags_body {
2813 print "<tr class=\"light\">\n";
2814 }
2815 $alternate ^= 1;
2816 - print "<td><i>$tag{'age'}</i></td>\n" .
2817 - "<td>" .
2816 + if (defined $tag{'age'}) {
2817 + print "<td><i>$tag{'age'}</i></td>\n";
2818 + } else {
2819 + print "<td></td>\n";
2820 + }
2821 + print "<td>" .
2822 $cgi->a({-href => href(action=>$tag{'reftype'}, hash=>$tag{'refid'}),
2823 -class => "list name"}, esc_html($tag{'name'})) .
2824 "</td>\n" .