Commit f1f9b5f7 authored by Rubén Dávila's avatar Rubén Dávila

Small fixes from code review. #3945

parent c476395b
...@@ -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
......
...@@ -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
......
...@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment