[#345] owner_and_name -> name_with_owner

This commit is contained in:
Alexander Machehin 2014-03-26 01:18:00 +06:00
parent 36d61d2e08
commit fc4ad9ac0a
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ module Rosa
def self.matches?(request) def self.matches?(request)
if (params = request.path_parameters) && params[:treeish] # parse existing branch (tag) and path if (params = request.path_parameters) && params[:treeish] # parse existing branch (tag) and path
branch_or_tag = begin branch_or_tag = begin
(p = Project.find_by_owner_and_name params[:owner_and_name]) && (p = Project.find_by_owner_and_name params[:name_with_owner]) &&
p.repo.branches_and_tags.map(&:name).sort{|a,b| b.length <=> a.length}.detect{|b| params[:treeish].start_with?(b)} || p.repo.branches_and_tags.map(&:name).sort{|a,b| b.length <=> a.length}.detect{|b| params[:treeish].start_with?(b)} ||
params[:treeish].split('/').first params[:treeish].split('/').first
end end