diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-20 20:32:52 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-20 20:32:52 +0000 |
commit | 303382c741388ab3e6f0088628fbd5dbea9270f2 (patch) | |
tree | 52c54d2aa16365ca7fc3f9a58efe4363e8dfd2db | |
parent | efb8783c4a3783fa53adf218da2d7388e56f226a (diff) | |
parent | 651397513ae302ffd36e10cf5f9ba43c1d673bdc (diff) | |
download | gitlab-ce-303382c741388ab3e6f0088628fbd5dbea9270f2.tar.gz |
Merge branch 'fix-commits-routing' into 'master'
Fix commits routing for branches with slash
Fixes https://github.com/gitlabhq/gitlabhq/issues/8990
See merge request !408
-rw-r--r-- | config/routes.rb | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/config/routes.rb b/config/routes.rb index 0950bed3cf1..03b4a32a9dd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -242,7 +242,7 @@ Gitlab::Application.routes.draw do resources :group_members, only: [:index, :create, :update, :destroy] do delete :leave, on: :collection end - + resource :avatar, only: [:destroy] resources :milestones, only: [:index, :show, :update] end @@ -318,14 +318,6 @@ Gitlab::Application.routes.draw do as: :tree ) end - resource :avatar, only: [:show, :destroy] - - resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ } do - get :branches, on: :member - end - - resources :commits, only: [:show], constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ } - resources :compare, only: [:index, :create] scope do get( @@ -336,8 +328,24 @@ Gitlab::Application.routes.draw do ) end - resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } - resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do + scope do + get( + '/commits/*id', + to: 'commits#show', + constraints: { id: /(?:[^.]|\.(?!atom$))+/, format: /atom/ }, + as: :commits + ) + end + + resource :avatar, only: [:show, :destroy] + resources :commit, only: [:show], constraints: { id: /[[:alnum:]]{6,40}/ } do + get :branches, on: :member + end + + resources :compare, only: [:index, :create] + resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } + + resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do member do get :commits end |