Method: Gitlab::Client::Commits#commit

Defined in:
lib/gitlab/client/commits.rb

#commit(project, sha) ⇒ Gitlab::ObjectifiedHash Also known as: repo_commit

Gets a specific commit identified by the commit hash or name of a branch or tag.

Examples:

Gitlab.commit(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
Gitlab.repo_commit(3, 'ed899a2f4b50b4370feeea94676502b42383c746')

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • sha (String)

    The commit hash or name of a repository branch or tag

Returns:

[View source]

33
34
35
# File 'lib/gitlab/client/commits.rb', line 33

def commit(project, sha)
  get("/projects/#{url_encode project}/repository/commits/#{sha}")
end