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
ef396d08
Commit
ef396d08
authored
Feb 15, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed encoding issue for diff. Reordered merge request commits
parent
65e4ad31
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+5
-1
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+1
-1
app/views/commits/_diffs.html.haml
app/views/commits/_diffs.html.haml
+2
-2
No files found.
app/controllers/merge_requests_controller.rb
View file @
ef396d08
...
...
@@ -49,7 +49,11 @@ class MergeRequestsController < ApplicationController
end
def
commits
@commits
=
@project
.
repo
.
commits_between
(
@merge_request
.
target_branch
,
@merge_request
.
source_branch
).
map
{
|
c
|
Commit
.
new
(
c
)}
@commits
=
@project
.
repo
.
commits_between
(
@merge_request
.
target_branch
,
@merge_request
.
source_branch
).
map
{
|
c
|
Commit
.
new
(
c
)}.
sort_by
(
&
:created_at
).
reverse
end
def
diffs
...
...
app/helpers/commits_helper.rb
View file @
ef396d08
...
...
@@ -58,7 +58,7 @@ module CommitsHelper
next
if
line
.
match
(
/^\-\-\- a/
)
next
if
line
.
match
(
/^\+\+\+ b/
)
full_line
=
html_escape
(
line
.
gsub
(
/\n/
,
''
))
full_line
=
html_escape
(
line
.
gsub
(
/\n/
,
''
))
.
force_encoding
(
"UTF-8"
)
if
line
.
match
(
/^@@ -/
)
next
if
line_old
==
1
&&
line_new
==
1
...
...
app/views/commits/_diffs.html.haml
View file @
ef396d08
...
...
@@ -16,7 +16,7 @@
%br
/
.diff_file_content
-
if
file
.
text?
=
render
:partial
=>
"commits/text_file"
,
:locals
=>
{
:diff
=>
diff
,
:index
=>
i
}
=
render
"commits/text_file"
,
:diff
=>
diff
,
:index
=>
i
-
elsif
file
.
image?
.diff_file_content_image
%img
{
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
...
...
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