... | ... |
@@ -539,23 +539,38 @@ sub path_by_id { |
539 | 539 |
return; |
540 | 540 |
} |
541 | 541 |
|
542 |
-sub project_description { |
|
543 |
- my ($self, $project) = @_; |
|
542 |
+sub rep { |
|
543 |
+ my ($self, $user, $project) = @_; |
|
544 |
+ |
|
545 |
+ my $home = $self->rep_home; |
|
546 |
+ |
|
547 |
+ return "$home/$user/$project.git"; |
|
548 |
+} |
|
549 |
+ |
|
550 |
+sub description { |
|
551 |
+ my ($self, $user, $project) = @_; |
|
552 |
+ |
|
553 |
+ my $rep = $self->rep($user, $project); |
|
544 | 554 |
|
545 | 555 |
# Project Description |
546 |
- my $file = "$project/description"; |
|
556 |
+ my $file = "$rep/description"; |
|
547 | 557 |
my $description = $self->_slurp($file) || ''; |
548 | 558 |
|
549 | 559 |
return $description; |
550 | 560 |
} |
551 | 561 |
|
552 | 562 |
sub last_activity { |
553 |
- my ($self, $project) = @_; |
|
563 |
+ my ($self, $user, $project) = @_; |
|
554 | 564 |
|
555 | 565 |
# Command "git for-each-ref" |
556 |
- my @cmd = ($self->cmd($project), 'for-each-ref', |
|
557 |
- '--format=%(committer)', '--sort=-committerdate', |
|
558 |
- '--count=1', 'refs/heads'); |
|
566 |
+ my @cmd = $self->_cmd( |
|
567 |
+ $user, |
|
568 |
+ $project, |
|
569 |
+ 'for-each-ref', |
|
570 |
+ '--format=%(committer)', |
|
571 |
+ '--sort=-committerdate', |
|
572 |
+ '--count=1', 'refs/heads' |
|
573 |
+ ); |
|
559 | 574 |
open my $fh, '-|', @cmd or return; |
560 | 575 |
my $most_recent = $self->dec(scalar <$fh>); |
561 | 576 |
close $fh or return; |
... | ... |
@@ -645,7 +660,7 @@ sub projects { |
645 | 660 |
my $project = $rep_name; |
646 | 661 |
$project =~ s/\.git$//; |
647 | 662 |
my $rep_path = "$home/$user/$rep_name"; |
648 |
- my @activity = $self->last_activity($rep_path); |
|
663 |
+ my @activity = $self->last_activity($user, $project); |
|
649 | 664 |
|
650 | 665 |
my $rep = {}; |
651 | 666 |
$rep->{name} = $project; |
... | ... |
@@ -654,7 +669,7 @@ sub projects { |
654 | 669 |
$rep->{age_string} = $activity[1]; |
655 | 670 |
} |
656 | 671 |
|
657 |
- my $description = $self->project_description($rep_path) || ''; |
|
672 |
+ my $description = $self->description($user, $project) || ''; |
|
658 | 673 |
$rep->{description} = $self->_chop_str($description, 25, 5); |
659 | 674 |
|
660 | 675 |
push @reps, $rep; |