Make the tree fragment work as expected so that you can browse trees again
[catagits/Gitalist.git] / lib / Gitalist / URIStructure / Commit.pm
CommitLineData
0da7966e 1package Gitalist::URIStructure::Commit;
2use MooseX::MethodAttributes::Role;
3use namespace::autoclean;
4
5requires 'base';
6
7after 'base' => sub {
8 my ($self, $c) = @_;
9 confess("No repository in the stash")
10 unless $c->stash->{Repository};
11};
12
13sub 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 20sub diff : Chained('find') CaptureArgs(0) {}
21
22sub diff_fancy : Chained('diff') PathPart('') Args(0) {}
23
24sub diff_plain : Chained('diff') PathPart('plain') Args(0) {}
0da7966e 25
1b33f63b 26sub tree : Chained('find') Args() {}
0da7966e 27
d361d955 28sub commit : Chained('find') PathPart('') {}
0da7966e 29
1f9a47c2 30sub blob : Chained('find') Args() {}
31
32sub blame : Chained('find') Args() {}
33
34sub history : Chained('find') Args() {}
35
36sub raw : Chained('find') Args() {}
37
0da7966e 381;