minor refactoring of commits controller
This commit is contained in:
parent
e4447de23f
commit
c106bb7096
1 changed files with 3 additions and 8 deletions
|
@ -64,19 +64,14 @@ class CommitsController < ApplicationController
|
||||||
@commit.to_patch,
|
@commit.to_patch,
|
||||||
type: "text/plain",
|
type: "text/plain",
|
||||||
disposition: 'attachment',
|
disposition: 'attachment',
|
||||||
filename: (@commit.id.to_s + ".patch")
|
filename: "#{@commit.id.patch}"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def load_refs
|
def load_refs
|
||||||
if params[:ref].blank?
|
@ref ||= params[:ref].presence || params[:branch].presence || params[:tag].presence
|
||||||
@branch = params[:branch].blank? ? nil : params[:branch]
|
@ref ||= @ref || @project.try(:default_branch) || 'master'
|
||||||
@tag = params[:tag].blank? ? nil : params[:tag]
|
|
||||||
@ref = @branch || @tag || @project.try(:default_branch) || 'master'
|
|
||||||
else
|
|
||||||
@ref = params[:ref]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue