Commit 8ff384c1 authored by Andrey Vakarev's avatar Andrey Vakarev
Browse files

Refactoring: get rid of ruby antipattern unless/else and use if/else instead

parent bb8d987f21d6
......@@ -97,9 +97,7 @@
end
def load_refs
unless params[:ref].blank?
@ref = params[:ref]
else
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) || Repository.default_ref
......@@ -103,6 +101,8 @@
@branch = params[:branch].blank? ? nil : params[:branch]
@tag = params[:tag].blank? ? nil : params[:tag]
@ref = @branch || @tag || @project.try(:default_branch) || Repository.default_ref
else
@ref = params[:ref]
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment