summaryrefslogtreecommitdiff
path: root/app/controllers/projects/commit_controller.rb
diff options
context:
space:
mode:
authorCiro Santilli <ciro.santilli@gmail.com>2014-10-19 23:20:55 +0200
committerCiro Santilli <ciro.santilli@gmail.com>2014-10-19 23:36:23 +0200
commit9e1b97ad99b239ace4a9383ef9d2bf0855c0dfd7 (patch)
treebd87d0d8d609e966fa681dd671a63b6383c1b00d /app/controllers/projects/commit_controller.rb
parent3880bb61760ef1f69b0df49148202ff6b4208f01 (diff)
downloadgitlab-ce-9e1b97ad99b239ace4a9383ef9d2bf0855c0dfd7.tar.gz
Use @project on controllers, don't call method
Also memoize the method to ensure that other methods in ApplicationController that rely on it can call it efficiently.
Diffstat (limited to 'app/controllers/projects/commit_controller.rb')
-rw-r--r--app/controllers/projects/commit_controller.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index 66c67b661db..df09ee7ed9d 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -11,12 +11,12 @@ class Projects::CommitController < Projects::ApplicationController
def show
return git_not_found! unless @commit
- @line_notes = project.notes.for_commit_id(commit.id).inline
- @branches = project.repository.branch_names_contains(commit.id)
+ @line_notes = @project.notes.for_commit_id(commit.id).inline
+ @branches = @project.repository.branch_names_contains(commit.id)
@diffs = @commit.diffs
- @note = project.build_commit_note(commit)
- @notes_count = project.notes.for_commit_id(commit.id).count
- @notes = project.notes.for_commit_id(@commit.id).not_inline.fresh
+ @note = @project.build_commit_note(commit)
+ @notes_count = @project.notes.for_commit_id(commit.id).count
+ @notes = @project.notes.for_commit_id(@commit.id).not_inline.fresh
@noteable = @commit
@comments_allowed = @reply_allowed = true
@comments_target = {
@@ -32,6 +32,6 @@ class Projects::CommitController < Projects::ApplicationController
end
def commit
- @commit ||= project.repository.commit(params[:id])
+ @commit ||= @project.repository.commit(params[:id])
end
end