summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-20 12:03:48 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-20 12:03:48 -0700
commit2852d0b6207fd1b14227a659a90d80fffa544e4c (patch)
tree5e199780d5f37fb0731c830b160a58fafc82e8cd
parentd735321ebdee53b84ea45090227cf2a571a534e0 (diff)
downloadgitlab-ce-fix-commits-routing.tar.gz
Fix commits routing for branches with slashfix-commits-routing
-rw-r--r--config/routes.rb31
1 files changed, 20 insertions, 11 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 0950bed3cf1..b1aeb686752 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,25 @@ 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: /.+/, format: /(html|js)/ },
+ as: :commits
+ )
+ 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]
+ resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }
+
+ resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do
member do
get :commits
end