Skip to content

Commit

Permalink
redirect .git access to /user/project
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-kimoto committed Feb 26, 2014
1 parent b8e93f4 commit e16bf0b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Gitprep.pm
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ sub startup {

# Smart HTTP
{

my $r = $r->route('/(:project).git', project => $id_re);

{
Expand Down Expand Up @@ -221,6 +222,16 @@ sub startup {
}
});

# /
$r->get('/')->to(cb => sub {
my $self = shift;

my $user = $self->param('user');
my $project = $self->param('project');

$self->redirect_to("/$user/$project");
});

# /info/refs
$r->get('/info/refs' => template 'smart-http/info-refs');

Expand Down

0 comments on commit e16bf0b

Please sign in to comment.