summaryrefslogtreecommitdiff
path: root/app/controllers/projects/commit_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-27 13:01:57 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-27 13:01:57 -0800
commit0d22b75b03496ced3d783f8fee9584098602ea1c (patch)
treec7ddec6072c716fd63a8703f2dfeb0e4234a633f /app/controllers/projects/commit_controller.rb
parent5f682094d9b7c985ad62ebe29664bb6fe87b54be (diff)
parentd4aab6528cb80b0f41bdac2240dd9cc32543481d (diff)
downloadgitlab-ce-0d22b75b03496ced3d783f8fee9584098602ea1c.tar.gz
Merge branch 'master' into mmonaco/gitlab-ce-api-user-noconfirm
Conflicts: lib/api/users.rb
Diffstat (limited to 'app/controllers/projects/commit_controller.rb')
-rw-r--r--app/controllers/projects/commit_controller.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index cf05e6ea220..87e39f1363a 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -3,16 +3,14 @@
# Not to be confused with CommitsController, plural.
class Projects::CommitController < Projects::ApplicationController
# Authorize
- before_filter :authorize_read_project!
- before_filter :authorize_download_code!
before_filter :require_non_empty_project
+ before_filter :authorize_download_code!
before_filter :commit
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)
@diffs = @commit.diffs
@note = @project.build_commit_note(commit)
@notes_count = @project.notes.for_commit_id(commit.id).count
@@ -31,6 +29,12 @@ class Projects::CommitController < Projects::ApplicationController
end
end
+ def branches
+ @branches = @project.repository.branch_names_contains(commit.id)
+ @tags = @project.repository.tag_names_contains(commit.id)
+ render layout: false
+ end
+
def commit
@commit ||= @project.repository.commit(params[:id])
end