Commit | Line | Data |
0da7966e |
1 | package Gitalist::URIStructure::Commit; |
2 | use MooseX::MethodAttributes::Role; |
3 | use namespace::autoclean; |
4 | |
5 | requires 'base'; |
6 | |
7 | after 'base' => sub { |
8 | my ($self, $c) = @_; |
9 | confess("No repository in the stash") |
10 | unless $c->stash->{Repository}; |
11 | }; |
12 | |
13 | sub find : Chained('base') PathPart('') CaptureArgs(1) { |
14 | my ($self, $c, $sha1part) = @_; |
15 | # FIXME - Should not be here! |
16 | $c->stash->{Commit} = $c->stash->{Repository}->get_object($sha1part) |
17 | or $c->detach('/error404', "Couldn't find a object for '$sha1part' in XXXX!"); |
18 | } |
19 | |
d361d955 |
20 | sub diff : Chained('find') CaptureArgs(0) {} |
21 | |
22 | sub diff_fancy : Chained('diff') PathPart('') Args(0) {} |
23 | |
24 | sub diff_plain : Chained('diff') PathPart('plain') Args(0) {} |
0da7966e |
25 | |
26 | sub tree : Chained('find') Args(0) {} |
27 | |
d361d955 |
28 | sub commit : Chained('find') PathPart('') {} |
0da7966e |
29 | |
30 | 1; |