diff --git a/lib/ext/rosa/constraints.rb b/lib/ext/rosa/constraints.rb index 5220c8f02..8d4aa4340 100644 --- a/lib/ext/rosa/constraints.rb +++ b/lib/ext/rosa/constraints.rb @@ -22,7 +22,7 @@ module Rosa def self.matches?(request) if (params = request.path_parameters) && params[:treeish] # parse existing branch (tag) and path 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)} || params[:treeish].split('/').first end