Commit | Line | Data |
ecb0ebe7 |
1 | package Gitalist::URIStructure::Repository; |
2 | use MooseX::MethodAttributes::Role; |
3 | use Try::Tiny qw/try catch/; |
4 | use namespace::autoclean; |
5 | |
6 | requires 'base'; |
7 | |
ecb0ebe7 |
8 | sub find : Chained('base') PathPart('') CaptureArgs(1) { |
12a0f9d3 |
9 | my ($self, $c, $repos_name) = @_; |
16dcb884 |
10 | # XXX FIXME - This should be in the repository fragment controller, and the repository |
11 | # controller should just check has_repository |
ecb0ebe7 |
12 | try { |
12a0f9d3 |
13 | my $repos = $c->model()->get_repository($repos_name); |
14 | $c->stash( |
15 | Repository => $repos, |
16 | HEAD => $repos->head_hash, |
17 | ); |
ecb0ebe7 |
18 | } |
19 | catch { |
20 | $c->detach('/error_404'); |
21 | }; |
22 | } |
23 | |
24 | sub summary : Chained('find') PathPart('') Args(0) {} |
25 | |
ecb0ebe7 |
26 | sub heads : Chained('find') Args(0) {} |
27 | |
5cb2f569 |
28 | sub tags : Chained('find') Args(0) {} |
29 | |
b9c202e2 |
30 | sub log : Chained('find') PathPart('') CaptureArgs(0) {} |
31 | |
32 | sub shortlog : Chained('log') Args(0) {} |
33 | |
34 | sub longlog : Chained('log') PathPart('log') Args(0) {} |
35 | |
ecb0ebe7 |
36 | 1; |