diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d467bf372a..c2eeca9fa0 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -728,7 +728,9 @@ sub chop_str {
sub age_class {
my $age = shift;
- if ($age < 60*60*2) {
+ if (!defined $age) {
+ return "noage";
+ } elsif ($age < 60*60*2) {
return "age0";
} elsif ($age < 60*60*24*2) {
return "age1";
@@ -1258,7 +1260,8 @@ sub git_get_last_activity {
'refs/heads') or return;
my $most_recent = <$fd>;
close $fd or return;
- if ($most_recent =~ / (\d+) [-+][01]\d\d\d$/) {
+ if (defined $most_recent &&
+ $most_recent =~ / (\d+) [-+][01]\d\d\d$/) {
my $timestamp = $1;
my $age = time - $timestamp;
return ($age, age_string($age));
@@ -2983,7 +2986,7 @@ sub git_project_list_body {
esc_html($pr->{'descr'})) . "\n" .
"
" . chop_str($pr->{'owner'}, 15) . " | \n";
print "{'age'}) . "\">" .
- $pr->{'age_string'} . " | \n" .
+ (defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "\n" .
"" .
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary")}, "summary") . " | " .
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"shortlog")}, "shortlog") . " | " .
@@ -3335,7 +3338,7 @@ sub git_project_index {
sub git_summary {
my $descr = git_get_project_description($project) || "none";
my %co = parse_commit("HEAD");
- my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'});
+ my %cd = %co ? parse_date($co{'committer_epoch'}, $co{'committer_tz'}) : ();
my $head = $co{'id'};
my $owner = git_get_project_owner($project);
@@ -3358,8 +3361,11 @@ sub git_summary {
print " \n";
print "\n" .
"description | " . esc_html($descr) . " | \n" .
- "owner | $owner | \n" .
- "last change | $cd{'rfc2822'} | \n";
+ "owner | $owner | \n";
+ if (defined $cd{'rfc2822'}) {
+ print "last change | $cd{'rfc2822'} | \n";
+ }
+
# use per project git URL list in $projectroot/$project/cloneurl
# or make project git URL from git base URL and project name
my $url_tag = "URL";
@@ -3382,11 +3388,13 @@ sub git_summary {
# we need to request one more than 16 (0..15) to check if
# those 16 are all
- my @commitlist = parse_commits($head, 17);
- git_print_header_div('shortlog');
- git_shortlog_body(\@commitlist, 0, 15, $refs,
- $#commitlist <= 15 ? undef :
- $cgi->a({-href => href(action=>"shortlog")}, "..."));
+ my @commitlist = $head ? parse_commits($head, 17) : ();
+ if (@commitlist) {
+ git_print_header_div('shortlog');
+ git_shortlog_body(\@commitlist, 0, 15, $refs,
+ $#commitlist <= 15 ? undef :
+ $cgi->a({-href => href(action=>"shortlog")}, "..."));
+ }
if (@taglist) {
git_print_header_div('tags');
|