From 1dae37f613838b2ada8b8f872abec71b256cb1ad Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 17 Dec 2015 18:28:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0commit=E6=80=BB=E6=95=B0=20ap?= =?UTF-8?q?i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/gitlab/client/repositories.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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