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
Boxiang Sun
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
...
@@ -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
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