gitlab-org--gitlab-foss/app/controllers/projects/commits_controller.rb

25 lines
696 B
Ruby
Raw Normal View History

2011-10-08 17:36:38 -04:00
require "base64"
class Projects::CommitsController < Projects::ApplicationController
include ExtractsPath
before_action :require_non_empty_project
before_action :assign_ref_vars
before_action :authorize_download_code!
2011-10-08 17:36:38 -04:00
def show
2013-01-03 14:09:18 -05:00
@repo = @project.repository
@limit, @offset = (params[:limit] || 40).to_i, (params[:offset] || 0).to_i
2013-01-03 14:09:18 -05:00
@commits = @repo.commits(@ref, @path, @limit, @offset)
@note_counts = project.notes.where(commit_id: @commits.map(&:id)).
group(:commit_id).count
2011-10-08 17:36:38 -04:00
respond_to do |format|
format.html
format.json { pager_json("projects/commits/_commits", @commits.size) }
format.atom { render layout: false }
2011-10-08 17:36:38 -04:00
end
end
end