remove unnecessary Commit.new

master
Dmitriy Zaporozhets 2013-03-31 23:58:17 +03:00
parent bbfbff3add
commit 458631c5ba
3 changed files with 2 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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