From bb63459d537fcd658be0638527e33fc1df56a48f Mon Sep 17 00:00:00 2001
From: Sato Hiroyuki <sathiroyuki@gmail.com>
Date: Wed, 6 Mar 2013 13:42:45 +0900
Subject: [PATCH] Fix routing errors.

It should fix #2598.
---
 config/routes.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/config/routes.rb b/config/routes.rb
index 57eefe23abb..3550636c91c 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -165,7 +165,7 @@ Gitlab::Application.routes.draw do
   #
   # Project Area
   #
-  resources :projects, constraints: { id: /[a-zA-Z.0-9_\-\/]+/ }, except: [:new, :create, :index], path: "/" do
+  resources :projects, constraints: { id: /(?:[a-zA-Z.0-9_\-]+\/)?[a-zA-Z.0-9_\-]+/ }, except: [:new, :create, :index], path: "/" do
     member do
       get "wall"
       get "files"
@@ -174,10 +174,10 @@ Gitlab::Application.routes.draw do
     resources :blob,    only: [:show], constraints: {id: /.+/}
     resources :tree,    only: [:show, :edit, :update], constraints: {id: /.+/}
     resources :commit,  only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
-    resources :commits, only: [:show], constraints: {id: /.+/}
+    resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
     resources :compare, only: [:index, :create]
     resources :blame,   only: [:show], constraints: {id: /.+/}
-    resources :graph,   only: [:show], constraints: {id: /.+/}
+    resources :graph,   only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
     match "/compare/:from...:to" => "compare#show", as: "compare",
                     :via => [:get, :post], constraints: {from: /.+/, to: /.+/}
 
-- 
GitLab