Fix branch with dots. Refs #263
This commit is contained in:
parent
60b4f6a561
commit
b46a7aba39
|
@ -179,31 +179,33 @@ Rosa::Application.routes.draw do
|
|||
get '/sections' => 'projects#sections', :as => :sections_project
|
||||
post '/sections' => 'projects#sections'
|
||||
delete '/remove_user' => 'projects#remove_user', :as => :remove_user_project
|
||||
# Tree
|
||||
get '/' => "git/trees#show", :as => :project
|
||||
get '/tree/:treeish(/*path)' => "git/trees#show", :defaults => {:treeish => :master}, :as => :tree, :format => false
|
||||
# Commits
|
||||
get '/commits/:treeish(/*path)' => "git/commits#index", :defaults => {:treeish => :master}, :as => :commits, :format => false
|
||||
get '/commit/:id(.:format)' => "git/commits#show", :as => :commit
|
||||
# Commit comments
|
||||
post '/commit/:commit_id/comments(.:format)' => "comments#create", :as => :project_commit_comments
|
||||
get '/commit/:commit_id/comments/:id(.:format)' => "comments#edit", :as => :edit_project_commit_comment
|
||||
put '/commit/:commit_id/comments/:id(.:format)' => "comments#update", :as => :project_commit_comment
|
||||
delete '/commit/:commit_id/comments/:id(.:format)' => "comments#destroy"
|
||||
# Commit subscribes
|
||||
post '/commit/:commit_id/subscribe' => "commit_subscribes#create", :as => :subscribe_commit
|
||||
delete '/commit/:commit_id/unsubscribe' => "commit_subscribes#destroy", :as => :unsubscribe_commit
|
||||
# Editing files
|
||||
get '/blob/:treeish/*path/edit' => "git/blobs#edit", :defaults => {:treeish => :master}, :as => :edit_blob
|
||||
put '/blob/:treeish/*path' => "git/blobs#update", :defaults => {:treeish => :master}, :format => false
|
||||
# Blobs
|
||||
get '/blob/:treeish/*path' => "git/blobs#show", :defaults => {:treeish => :master}, :as => :blob, :format => false
|
||||
# Blame
|
||||
get '/blame/:treeish/*path' => "git/blobs#blame", :defaults => {:treeish => :master}, :as => :blame, :format => false
|
||||
# Raw
|
||||
get '/raw/:treeish/*path' => "git/blobs#raw", :defaults => {:treeish => :master}, :as => :raw, :format => false
|
||||
# Archive
|
||||
get '/archive/:format/tree/:treeish' => "git/trees#archive", :defaults => {:treeish => :master}, :as => :archive, :format => /zip|tar/
|
||||
constraints :treeish => /[^\/]+/ do
|
||||
# Tree
|
||||
get '/' => "git/trees#show", :as => :project
|
||||
get '/tree/:treeish(/*path)' => "git/trees#show", :defaults => {:treeish => :master}, :as => :tree, :format => false
|
||||
# Commits
|
||||
get '/commits/:treeish(/*path)' => "git/commits#index", :defaults => {:treeish => :master}, :as => :commits, :format => false
|
||||
get '/commit/:id(.:format)' => "git/commits#show", :as => :commit
|
||||
# Commit comments
|
||||
post '/commit/:commit_id/comments(.:format)' => "comments#create", :as => :project_commit_comments
|
||||
get '/commit/:commit_id/comments/:id(.:format)' => "comments#edit", :as => :edit_project_commit_comment
|
||||
put '/commit/:commit_id/comments/:id(.:format)' => "comments#update", :as => :project_commit_comment
|
||||
delete '/commit/:commit_id/comments/:id(.:format)' => "comments#destroy"
|
||||
# Commit subscribes
|
||||
post '/commit/:commit_id/subscribe' => "commit_subscribes#create", :as => :subscribe_commit
|
||||
delete '/commit/:commit_id/unsubscribe' => "commit_subscribes#destroy", :as => :unsubscribe_commit
|
||||
# Editing files
|
||||
get '/blob/:treeish/*path/edit' => "git/blobs#edit", :defaults => {:treeish => :master}, :as => :edit_blob
|
||||
put '/blob/:treeish/*path' => "git/blobs#update", :defaults => {:treeish => :master}, :format => false
|
||||
# Blobs
|
||||
get '/blob/:treeish/*path' => "git/blobs#show", :defaults => {:treeish => :master}, :as => :blob, :format => false
|
||||
# Blame
|
||||
get '/blame/:treeish/*path' => "git/blobs#blame", :defaults => {:treeish => :master}, :as => :blame, :format => false
|
||||
# Raw
|
||||
get '/raw/:treeish/*path' => "git/blobs#raw", :defaults => {:treeish => :master}, :as => :raw, :format => false
|
||||
# Archive
|
||||
get '/archive/:format/tree/:treeish' => "git/trees#archive", :defaults => {:treeish => :master}, :as => :archive, :format => /zip|tar/
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@ ActiveRecord::Schema.define(:version => 20120628165702) do
|
|||
t.integer "build_count", :default => 0, :null => false
|
||||
end
|
||||
|
||||
add_index "projects", ["owner_id"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true
|
||||
add_index "projects", ["owner_id"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true, :case_sensitive => false
|
||||
|
||||
create_table "register_requests", :force => true do |t|
|
||||
t.string "name"
|
||||
|
|
|
@ -36,8 +36,9 @@ describe Projects::Git::TreesController do
|
|||
|
||||
it "routes to #show" do
|
||||
get("/import/glib2.0-mib").should route_to("projects/git/trees#show", :owner_name => 'import', :project_name => 'glib2.0-mib')
|
||||
get("/import/glib2.0-mib/tree/branch").should route_to("projects/git/trees#show", :owner_name => 'import', :project_name => 'glib2.0-mib', :treeish => 'branch')
|
||||
get("/import/glib2.0-mib/tree/branch/some/path.to").should route_to("projects/git/trees#show", :owner_name => 'import', :project_name => 'glib2.0-mib', :treeish => 'branch', :path => 'some/path.to')
|
||||
get("/import/glib2.0-mib/tree/lib2safe-0.03").should route_to("projects/git/trees#show", :owner_name => 'import', :project_name => 'glib2.0-mib', :treeish => 'lib2safe-0.03')
|
||||
get("/import/glib2.0-mib/tree/branch-with.dot/folder_with.dot/path-with.dot").should route_to("projects/git/trees#show", :owner_name => 'import', :project_name => 'glib2.0-mib', :treeish => 'branch-with.dot', :path => 'folder_with.dot/path-with.dot')
|
||||
# get("/import/glib2.0-mib/tree/ветка-с.точкой/папка_с.точкой/путь-с.точкой").should route_to("projects/git/trees#show", :owner_name => 'import', :project_name => 'glib2.0-mib', :treeish => 'ветка-с.точкой', :path => 'папка_с.точкой/путь-с.точкой')
|
||||
end
|
||||
|
||||
# TODO write more specs also with slash in branch name!
|
||||
|
|
Loading…
Reference in New Issue