#944 fix error with branches list
This commit is contained in:
parent
2ba37b5da4
commit
e9dec9192f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue