Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix build-project-list.pl dieing on repositories with a single commit

Instead of an arrayref containing hashrefs for commits, we get a single
hashref, because there's only one commit :)
  • Loading branch information...
commit dcd11a70d03c99c3334d979a1e98765ff5319b93 1 parent 8af90f1
@niner niner authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  web/lib/P6Project/Hosts/Github.pm
View
2  web/lib/P6Project/Hosts/Github.pm
@@ -95,7 +95,7 @@ sub set_project_info {
$project->{url} = $url;
my $commits = $self->get_api($project, "/commits") or return 0;
- my $latest = $commits->[0];
+ my $latest = ref $commits eq 'ARRAY' ? $commits->[0] : $commits; # if it's a single commit, we get the hashref directly
my $updated = $latest->{commit}->{committer}->{date};
$project->{last_updated} = $updated;
Please sign in to comment.
Something went wrong with that request. Please try again.