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
@commit = @merge_request.last_commit
@first_commit = @merge_request.first_commit
@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
@statuses = @ci_commit.statuses if @ci_commit
......
......@@ -11,14 +11,14 @@ module BlobHelper
end
def highlight(blob_name, blob_content, nowrap: false, continue: false)
@formatter ||= rouge_formatter(nowrap: nowrap)
formatter = rouge_formatter(nowrap: nowrap)
begin
@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
@lexer = Rouge::Lexers::PlainText
result = @formatter.format(@lexer.lex(blob_content)).html_safe
result = formatter.format(@lexer.lex(blob_content)).html_safe
end
result
......
......@@ -125,10 +125,6 @@ module Gitlab
lines.map! { |line| " #{line}" }
end
end
def submodules
@submodules ||= diff_repository.raw_repository.submodules(diff_new_ref).keys
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