diff --git a/app/contexts/commit_load_context.rb b/app/contexts/commit_load_context.rb index a06523776cc..2cf5420d62d 100644 --- a/app/contexts/commit_load_context.rb +++ b/app/contexts/commit_load_context.rb @@ -12,7 +12,6 @@ class CommitLoadContext < BaseContext commit = project.repository.commit(params[:id]) if commit - commit = Commit.new(commit) line_notes = project.notes.for_commit_id(commit.id).inline result[:commit] = commit diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index da209e06421..66603c97142 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -109,9 +109,7 @@ module CommitsHelper end def commit_to_html commit - if commit.model - escape_javascript(render 'commits/commit', commit: commit) - end + escape_javascript(render 'commits/commit', commit: commit) end def diff_line_content(line) diff --git a/app/models/note.rb b/app/models/note.rb index 17ceb541b80..f26420ca2a0 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -130,7 +130,7 @@ class Note < ActiveRecord::Base # override to return commits, which are not active record def noteable if for_commit? - Commit.new(project.repository.commit(commit_id)) + project.repository.commit(commit_id) else super end