Commit c830bab79a86d2397d1bd66c911e549377e396b4

Authored by Johannes Schleifenbaum
1 parent 37ff9d88

Commit List and Tree allow also + in branch name

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