Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
fed1c980
Commit
fed1c980
authored
May 20, 2012
by
Andrey Vakarev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring: get rid of ruby antipattern unless/else and use if/else instead
parent
f33cf247
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+3
-3
No files found.
app/controllers/application_controller.rb
View file @
fed1c980
...
@@ -97,12 +97,12 @@ class ApplicationController < ActionController::Base
...
@@ -97,12 +97,12 @@ class ApplicationController < ActionController::Base
end
end
def
load_refs
def
load_refs
unless
params
[
:ref
].
blank?
if
params
[
:ref
].
blank?
@ref
=
params
[
:ref
]
else
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
@tag
=
params
[
:tag
].
blank?
?
nil
:
params
[
:tag
]
@tag
=
params
[
:tag
].
blank?
?
nil
:
params
[
:tag
]
@ref
=
@branch
||
@tag
||
@project
.
try
(
:default_branch
)
||
Repository
.
default_ref
@ref
=
@branch
||
@tag
||
@project
.
try
(
:default_branch
)
||
Repository
.
default_ref
else
@ref
=
params
[
:ref
]
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment