From bd50a9f466b3df15917b32142bfc325114ef811a Mon Sep 17 00:00:00 2001 From: Markus Grobelin Date: Fri, 26 Oct 2012 14:05:57 +0200 Subject: [PATCH] grack: allow repositories to have dots in name, e.g. serverconfigs-example.com.git --- config/routes.rb | 2 +- lib/gitlab/backend/grack_auth.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index adaf6a1e..e597c61e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,7 +18,7 @@ Gitlab::Application.routes.draw do project_root: Gitlab.config.git_base_path, upload_pack: Gitlab.config.git_upload_pack, receive_pack: Gitlab.config.git_receive_pack - }), at: '/:path', constraints: { path: /[\w-]+\.git/ } + }), at: '/:path', constraints: { path: /[\w\.-]+\.git/ } # # Help diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb index 766e3874..dd5a9bec 100644 --- a/lib/gitlab/backend/grack_auth.rb +++ b/lib/gitlab/backend/grack_auth.rb @@ -18,7 +18,7 @@ module Grack @env['SCRIPT_NAME'] = "" # Find project by PATH_INFO from env - if m = /^\/([\w-]+).git/.match(@request.path_info).to_a + if m = /^\/([\w\.-]+)\.git/.match(@request.path_info).to_a self.project = Project.find_by_path(m.last) return false unless project end @@ -65,7 +65,7 @@ module Grack end # Need to reset seek point @request.body.rewind - /refs\/heads\/([\w-]+)/.match(input).to_a.first + /refs\/heads\/([\w\.-]+)/.match(input).to_a.first end protected