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
Léo-Paul Géneau
gitlab-ce
Commits
ef396d08
Commit
ef396d08
authored
12 years ago
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
Hide 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
...
@@ -49,7 +49,11 @@ class MergeRequestsController < ApplicationController
end
end
def
commits
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
end
def
diffs
def
diffs
...
...
This diff is collapsed.
Click to expand it.
app/helpers/commits_helper.rb
View file @
ef396d08
...
@@ -58,7 +58,7 @@ module CommitsHelper
...
@@ -58,7 +58,7 @@ module CommitsHelper
next
if
line
.
match
(
/^\-\-\- a/
)
next
if
line
.
match
(
/^\-\-\- a/
)
next
if
line
.
match
(
/^\+\+\+ b/
)
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
(
/^@@ -/
)
if
line
.
match
(
/^@@ -/
)
next
if
line_old
==
1
&&
line_new
==
1
next
if
line_old
==
1
&&
line_new
==
1
...
...
This diff is collapsed.
Click to expand it.
app/views/commits/_diffs.html.haml
View file @
ef396d08
.file_stats
.file_stats
=
render
"commits/diff_head"
,
:diffs
=>
diffs
=
render
"commits/diff_head"
,
:diffs
=>
diffs
-
diffs
.
each_with_index
do
|
diff
,
i
|
-
diffs
.
each_with_index
do
|
diff
,
i
|
-
next
if
diff
.
diff
.
empty?
-
next
if
diff
.
diff
.
empty?
-
file
=
(
@commit
.
tree
/
diff
.
b_path
)
-
file
=
(
@commit
.
tree
/
diff
.
b_path
)
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
%br
/
%br
/
.diff_file_content
.diff_file_content
-
if
file
.
text?
-
if
file
.
text?
=
render
:partial
=>
"commits/text_file"
,
:locals
=>
{
:diff
=>
diff
,
:index
=>
i
}
=
render
"commits/text_file"
,
:diff
=>
diff
,
:index
=>
i
-
elsif
file
.
image?
-
elsif
file
.
image?
.diff_file_content_image
.diff_file_content_image
%img
{
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
%img
{
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
...
...
This diff is collapsed.
Click to expand it.
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