That was the only place it was used.
end
end
- def load_refs
- if params[:ref].blank?
- @branch = params[:branch].blank? ? nil : params[:branch]
- @tag = params[:tag].blank? ? nil : params[:tag]
- @ref = @branch || @tag || @project.try(:default_branch) || 'master'
- else
- @ref = params[:ref]
- end
- end
-
def render_404
render file: File.join(Rails.root, "public", "404"), layout: false, status: "404"
end
def patch
@commit = project.commit(params[:id])
-
+
send_data(
@commit.to_patch,
type: "text/plain",
filename: (@commit.id.to_s + ".patch")
)
end
+
+ protected
+
+ def load_refs
+ if params[:ref].blank?
+ @branch = params[:branch].blank? ? nil : params[:branch]
+ @tag = params[:tag].blank? ? nil : params[:tag]
+ @ref = @branch || @tag || @project.try(:default_branch) || 'master'
+ else
+ @ref = params[:ref]
+ end
+ end
end