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
Kazuhiko Shiozaki
gitlab-ce
Commits
f1f9b5f7
Commit
f1f9b5f7
authored
Jan 12, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes from code review. #3945
parent
c476395b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
8 deletions
+4
-8
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+3
-3
lib/gitlab/diff/highlight.rb
lib/gitlab/diff/highlight.rb
+0
-4
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
f1f9b5f7
...
@@ -104,7 +104,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -104,7 +104,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@commit
=
@merge_request
.
last_commit
@commit
=
@merge_request
.
last_commit
@first_commit
=
@merge_request
.
first_commit
@first_commit
=
@merge_request
.
first_commit
@diffs
=
@merge_request
.
compare_diffs
@diffs
=
@merge_request
.
compare_diffs
@diff_refs
=
[
@merge_request
.
target_sha
,
@merge_request
.
source_
branch
]
@diff_refs
=
[
@merge_request
.
target_sha
,
@merge_request
.
source_
sha
]
@ci_commit
=
@merge_request
.
ci_commit
@ci_commit
=
@merge_request
.
ci_commit
@statuses
=
@ci_commit
.
statuses
if
@ci_commit
@statuses
=
@ci_commit
.
statuses
if
@ci_commit
...
...
app/helpers/blob_helper.rb
View file @
f1f9b5f7
...
@@ -11,14 +11,14 @@ module BlobHelper
...
@@ -11,14 +11,14 @@ module BlobHelper
end
end
def
highlight
(
blob_name
,
blob_content
,
nowrap:
false
,
continue:
false
)
def
highlight
(
blob_name
,
blob_content
,
nowrap:
false
,
continue:
false
)
@formatter
||
=
rouge_formatter
(
nowrap:
nowrap
)
formatter
=
rouge_formatter
(
nowrap:
nowrap
)
begin
begin
@lexer
||=
Rouge
::
Lexer
.
guess
(
filename:
blob_name
,
source:
blob_content
).
new
@lexer
||=
Rouge
::
Lexer
.
guess
(
filename:
blob_name
,
source:
blob_content
).
new
result
=
@
formatter
.
format
(
@lexer
.
lex
(
blob_content
,
continue:
continue
)).
html_safe
result
=
formatter
.
format
(
@lexer
.
lex
(
blob_content
,
continue:
continue
)).
html_safe
rescue
rescue
@lexer
=
Rouge
::
Lexers
::
PlainText
@lexer
=
Rouge
::
Lexers
::
PlainText
result
=
@
formatter
.
format
(
@lexer
.
lex
(
blob_content
)).
html_safe
result
=
formatter
.
format
(
@lexer
.
lex
(
blob_content
)).
html_safe
end
end
result
result
...
...
lib/gitlab/diff/highlight.rb
View file @
f1f9b5f7
...
@@ -125,10 +125,6 @@ module Gitlab
...
@@ -125,10 +125,6 @@ module Gitlab
lines
.
map!
{
|
line
|
"
#{
line
}
"
}
lines
.
map!
{
|
line
|
"
#{
line
}
"
}
end
end
end
end
def
submodules
@submodules
||=
diff_repository
.
raw_repository
.
submodules
(
diff_new_ref
).
keys
end
end
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