diff --git a/lib/gitlab-cli/lib/gitlab/client/repositories.rb b/lib/gitlab-cli/lib/gitlab/client/repositories.rb index f489e5009..4946304b9 100644 --- a/lib/gitlab-cli/lib/gitlab/client/repositories.rb +++ b/lib/gitlab-cli/lib/gitlab/client/repositories.rb @@ -58,6 +58,23 @@ class Gitlab::Client end alias_method :repo_commits, :commits + # Gets a list of project commits. + # + # @example + # Gitlab.commits('viking') + # Gitlab.repo_commits('gitlab', :ref_name => 'api') + # + # @param [Integer] project The ID of a project. + # @param [Hash] options A customizable set of options. + # @option options [String] :ref_name The branch or tag name of a project repository. + # @option options [Integer] :page The page number. + # @option options [Integer] :per_page The number of results per page. + # @return [Array] + def commits_total_count(project, options={}) + get("/projects/#{project}/repository/commits_total_count", :query => options) + end + alias_method :repo_commits, :commits_total_count + # Gets a specific commit identified by the commit hash or name of a branch or tag. # # @example