Commit 458631c5ba8c830021bd7c219affdb0afe6f0efe

Authored by Dmitriy Zaporozhets
1 parent bbfbff3a

remove unnecessary Commit.new

app/contexts/commit_load_context.rb
@@ -12,7 +12,6 @@ class CommitLoadContext < BaseContext @@ -12,7 +12,6 @@ class CommitLoadContext < BaseContext
12 commit = project.repository.commit(params[:id]) 12 commit = project.repository.commit(params[:id])
13 13
14 if commit 14 if commit
15 - commit = Commit.new(commit)  
16 line_notes = project.notes.for_commit_id(commit.id).inline 15 line_notes = project.notes.for_commit_id(commit.id).inline
17 16
18 result[:commit] = commit 17 result[:commit] = commit
app/helpers/commits_helper.rb
@@ -109,9 +109,7 @@ module CommitsHelper @@ -109,9 +109,7 @@ module CommitsHelper
109 end 109 end
110 110
111 def commit_to_html commit 111 def commit_to_html commit
112 - if commit.model  
113 - escape_javascript(render 'commits/commit', commit: commit)  
114 - end 112 + escape_javascript(render 'commits/commit', commit: commit)
115 end 113 end
116 114
117 def diff_line_content(line) 115 def diff_line_content(line)
app/models/note.rb
@@ -130,7 +130,7 @@ class Note < ActiveRecord::Base @@ -130,7 +130,7 @@ class Note < ActiveRecord::Base
130 # override to return commits, which are not active record 130 # override to return commits, which are not active record
131 def noteable 131 def noteable
132 if for_commit? 132 if for_commit?
133 - Commit.new(project.repository.commit(commit_id)) 133 + project.repository.commit(commit_id)
134 else 134 else
135 super 135 super
136 end 136 end