Skip to content
Snippets Groups Projects
Commit f1f9b5f7 authored by Rubén Dávila's avatar Rubén Dávila
Browse files

Small fixes from code review. #3945

parent c476395b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment