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)

    The ID of a project.

  • sha (String)

    The commit hash or name of a repository branch or tag

Returns:



31
32
33
# File 'lib/gitlab/client/commits.rb', line 31

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