my $ref = $c->req->param('hb') || $c->req->param('h');
return '/ref/blob', [$repos, $ref], $c->req->param('f');
},
+ blob_plain => sub {
+ my($c, $action, $repos) = @_;
+ my $ref = $c->req->param('hb') || $c->req->param('h');
+ return '/ref/raw', [$repos, $ref], $c->req->param('f');
+ },
);
sub _legacy_uri {
my($repo, $object) = @{$c->{stash}}{qw(Repository Commit)};
# FIXME - Eugh!
my $h = $object->isa('Gitalist::Git::Object::Commit')
- ? $repo->hash_by_path($object->sha1, $c->stash->{filename})
- : $object->isa('Gitalist::Git::Object::Blob')
+ ? $repo->hash_by_path($object->sha1, $c->stash->{filename})
+ : $object->isa('Gitalist::Git::Object::Blob')
? $object->sha1
: die "Unknown object type for '${\$object->sha1}'";
die "No file or sha1 provided."
test('/', 'a=blob;f=file1;hb=3f7567c7bdf7e7ebf410926493b92d398333116e');
-{
-
- local $TODO = 'FIXME';
-
test('/', 'a=blob_plain;f=dir1/file2;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
test('/', 'a=blob_plain;f=dir1/file2;hb=HEAD');
test('/', 'a=blob_plain;f=dir1/file2;hb=master');
test('/', 'a=blob_plain;f=file1;hb=master');
test('/', 'a=blob_plain;f=file1;hb=refs/heads/master');
+
+{
+
+ local $TODO = 'FIXME';
+
test('/', 'a=blobdiff;f=file1;h=5716ca5987cbf97d6bb54920bea6adde242d87e6;hp=257cc5642cb1a054f08cc83f2d943e56fd3ebe99;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818;hpb=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
test('/', 'a=blobdiff;f=file1;h=5716ca5987cbf97d6bb54920bea6adde242d87e6;hp=257cc5642cb1a054f08cc83f2d943e56fd3ebe99;hb=3f7567c7bdf7e7ebf410926493b92d398333116e;hpb=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
test('/', 'a=blobdiff;f=file1;h=5716ca5987cbf97d6bb54920bea6adde242d87e6;hp=257cc5642cb1a054f08cc83f2d943e56fd3ebe99;hb=HEAD;hpb=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');