Commit 458631c5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

remove unnecessary Commit.new

parent bbfbff3a
...@@ -12,7 +12,6 @@ class CommitLoadContext < BaseContext ...@@ -12,7 +12,6 @@ class CommitLoadContext < BaseContext
commit = project.repository.commit(params[:id]) commit = project.repository.commit(params[:id])
if commit if commit
commit = Commit.new(commit)
line_notes = project.notes.for_commit_id(commit.id).inline line_notes = project.notes.for_commit_id(commit.id).inline
result[:commit] = commit result[:commit] = commit
......
...@@ -109,10 +109,8 @@ module CommitsHelper ...@@ -109,10 +109,8 @@ module CommitsHelper
end end
def commit_to_html commit def commit_to_html commit
if commit.model
escape_javascript(render 'commits/commit', commit: commit) escape_javascript(render 'commits/commit', commit: commit)
end end
end
def diff_line_content(line) def diff_line_content(line)
if line.blank? if line.blank?
......
...@@ -130,7 +130,7 @@ class Note < ActiveRecord::Base ...@@ -130,7 +130,7 @@ class Note < ActiveRecord::Base
# override to return commits, which are not active record # override to return commits, which are not active record
def noteable def noteable
if for_commit? if for_commit?
Commit.new(project.repository.commit(commit_id)) project.repository.commit(commit_id)
else else
super super
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