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
Tatuya Kamada
gitlab-ce
Commits
335f9d64
Commit
335f9d64
authored
Jun 28, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Feature: Diff patch file export for commit
parent
df6b587f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+11
-0
app/models/commit.rb
app/models/commit.rb
+1
-0
app/views/commits/_commit_box.html.haml
app/views/commits/_commit_box.html.haml
+12
-1
config/routes.rb
config/routes.rb
+4
-0
No files found.
app/controllers/commits_controller.rb
View file @
335f9d64
...
@@ -64,4 +64,15 @@ class CommitsController < ApplicationController
...
@@ -64,4 +64,15 @@ class CommitsController < ApplicationController
@commit
=
Commit
.
new
(
older
)
@commit
=
Commit
.
new
(
older
)
end
end
end
end
def
patch
@commit
=
project
.
commit
(
params
[
:id
])
send_data
(
@commit
.
to_patch
,
:type
=>
"text/plain"
,
:disposition
=>
'attachment'
,
:filename
=>
(
@commit
.
id
.
to_s
+
".patch"
)
)
end
end
end
app/models/commit.rb
View file @
335f9d64
...
@@ -19,6 +19,7 @@ class Commit
...
@@ -19,6 +19,7 @@ class Commit
:diffs
,
:diffs
,
:tree
,
:tree
,
:id
,
:id
,
:to_patch
,
:to
=>
:commit
:to
=>
:commit
...
...
app/views/commits/_commit_box.html.haml
View file @
335f9d64
.commit-box
{
class:
@commit
.
parents
.
count
>
1
?
"merge-commit"
:
""
}
.commit-box
{
class:
@commit
.
parents
.
count
>
1
?
"merge-commit"
:
""
}
.commit-head
.commit-head
=
link_to
"Browse Code »"
,
tree_project_ref_path
(
@project
,
@commit
.
id
),
:class
=>
"browse-button"
.right
=
link_to
tree_project_ref_path
(
@project
,
@commit
.
id
),
:class
=>
"browse-button primary"
do
%strong
Browse Code »
-
if
@notes_count
>
0
%span
.btn.disabled
%i
.icon-comment
=
@notes_count
=
link_to
patch_project_commit_path
(
@project
,
@commit
.
id
),
:class
=>
"btn small"
do
%i
.icon-download-alt
Get Patch
%h3
.commit-title
%h3
.commit-title
=
commit_msg_with_link_to_issues
(
@project
,
@commit
.
title
)
=
commit_msg_with_link_to_issues
(
@project
,
@commit
.
title
)
-
if
@commit
.
description
.
present?
-
if
@commit
.
description
.
present?
...
...
config/routes.rb
View file @
335f9d64
...
@@ -154,6 +154,10 @@ Gitlab::Application.routes.draw do
...
@@ -154,6 +154,10 @@ Gitlab::Application.routes.draw do
collection
do
collection
do
get
:compare
get
:compare
end
end
member
do
get
:patch
end
end
end
resources
:team_members
resources
:team_members
resources
:milestones
resources
:milestones
...
...
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