diff options
author | Johannes Schleifenbaum <johannes@js-webcoding.de> | 2013-06-09 15:00:42 +0200 |
---|---|---|
committer | Johannes Schleifenbaum <johannes@js-webcoding.de> | 2013-06-09 16:28:55 +0200 |
commit | 37ff9d88ec0a9717900e05c26156f11f0e5ba5a5 (patch) | |
tree | 6ae869dac9bcfc127029765c8a0ce1ba6337f410 | |
parent | 05bc65895c083cf89e44e72c80918cda761cfaa1 (diff) | |
download | gitlab-ce-37ff9d88ec0a9717900e05c26156f11f0e5ba5a5.tar.gz |
Routing fix Commit-List: switch to branch with # in name
-rw-r--r-- | config/routes.rb | 4 | ||||
-rw-r--r-- | spec/routing/project_routing_spec.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/config/routes.rb b/config/routes.rb index c555cd0b361..1889461b68d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -251,11 +251,11 @@ Gitlab::Application.routes.draw do member do # tree viewer logs - get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } + get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-#%]+/ } get "logs_tree/:path" => "refs#logs_tree", as: :logs_file, constraints: { - id: /[a-zA-Z.0-9\/_\-]+/, + id: /[a-zA-Z.0-9\/_\-#%]+/, path: /.*/ } end diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index 94f9480a4d0..fab7ea25a0e 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -201,7 +201,9 @@ describe RefsController, "routing" do it "to #logs_tree" do get("/gitlabhq/refs/stable/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable') + get("/gitlabhq/refs/feature%2345/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45') get("/gitlabhq/refs/stable/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz') + get("/gitlabhq/refs/feature%2345/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45', path: 'foo/bar/baz') get("/gitlab/gitlabhq/refs/stable/logs_tree/files.scss").should route_to('refs#logs_tree', project_id: 'gitlab/gitlabhq', id: 'stable', path: 'files.scss') end end |