Subject: [PATCH] gitweb: Fix "Use of uninitialized value" warning in git_tags_body

From: Jakub Narebski <[email-masked]>
Date: Wed, 3 Jan 2007 22:54:29 +0100

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 <[email-masked]>
---
 gitweb/gitweb.perl |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 2179054..fd671f3 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2813,8 +2813,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" .
-- 
1.4.4.3