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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c106bb70
Commit
c106bb70
authored
Sep 06, 2012
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor refactoring of commits controller
parent
e4447de2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+3
-8
No files found.
app/controllers/commits_controller.rb
View file @
c106bb70
...
...
@@ -64,19 +64,14 @@ class CommitsController < ApplicationController
@commit
.
to_patch
,
type:
"text/plain"
,
disposition:
'attachment'
,
filename:
(
@commit
.
id
.
to_s
+
".patch"
)
filename:
"
#{
@commit
.
id
.
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
@ref
||=
params
[
:ref
].
presence
||
params
[
:branch
].
presence
||
params
[
:tag
].
presence
@ref
||=
@ref
||
@project
.
try
(
:default_branch
)
||
'master'
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