Commit 37ff9d88ec0a9717900e05c26156f11f0e5ba5a5

Authored by Johannes Schleifenbaum
1 parent 05bc6589

Routing fix Commit-List: switch to branch with # in name

config/routes.rb
... ... @@ -251,11 +251,11 @@ Gitlab::Application.routes.draw do
251 251  
252 252 member do
253 253 # tree viewer logs
254   - get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-]+/ }
  254 + get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-#%]+/ }
255 255 get "logs_tree/:path" => "refs#logs_tree",
256 256 as: :logs_file,
257 257 constraints: {
258   - id: /[a-zA-Z.0-9\/_\-]+/,
  258 + id: /[a-zA-Z.0-9\/_\-#%]+/,
259 259 path: /.*/
260 260 }
261 261 end
... ...
spec/routing/project_routing_spec.rb
... ... @@ -201,7 +201,9 @@ describe RefsController, "routing" do
201 201  
202 202 it "to #logs_tree" do
203 203 get("/gitlabhq/refs/stable/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable')
  204 + get("/gitlabhq/refs/feature%2345/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45')
204 205 get("/gitlabhq/refs/stable/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
  206 + 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')
205 207 get("/gitlab/gitlabhq/refs/stable/logs_tree/files.scss").should route_to('refs#logs_tree', project_id: 'gitlab/gitlabhq', id: 'stable', path: 'files.scss')
206 208 end
207 209 end
... ...