summaryrefslogtreecommitdiff
path: root/app/controllers/projects/blame_controller.rb
blob: e58b450720212df28c4726230d7c461d26bfa45b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Controller for viewing a file's blame
class Projects::BlameController < Projects::ApplicationController
  include ExtractsPath

  # Authorize
  before_filter :authorize_read_project!
  before_filter :authorize_code_access!
  before_filter :require_non_empty_project

  def show
    @blob = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, @path)
    @blame = Gitlab::Git::Blame.new(project.repository, @commit.id, @path)
  end
end