#944 fix error with branches list

This commit is contained in:
Alexander Machehin 2013-02-22 01:24:20 +06:00
parent 2ba37b5da4
commit e9dec9192f
2 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@ class Projects::Git::BaseController < Projects::BaseController
protected
def set_treeish_and_path
@treeish, @path = @project.default_head(params[:treeish]), params[:path]
@treeish, @path = params[:treeish].presence || @project.default_head, params[:path]
end
def set_branch_and_tree

View File

@ -33,7 +33,8 @@ class Projects::Git::TreesController < Projects::Git::BaseController
end
def branches
@branches = @project.repo.branches.sort_by(&:name).select{ |b| b.name != @branch.name }.unshift(@branch)
raise Grit::NoSuchPathError unless @branch
@branches = @project.repo.branches.sort_by(&:name).select{ |b| b.name != @branch.name }.unshift(@branch).compact
render 'refs'
end