Method: Gitlab::Client::Commits#commit_diff

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

#commit_diff(project, sha) ⇒ Gitlab::ObjectifiedHash Also known as: repo_commit_diff

Get the diff of a commit in a project.

Examples:

Gitlab.commit_diff(42, '6104942438c14ec7bd21c6cd5bd995272b3faff6')
Gitlab.repo_commit_diff(3, 'ed899a2f4b50b4370feeea94676502b42383c746')

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • sha (String)

    The name of a repository branch or tag or if not given the default branch.

Returns:



97
98
99
# File 'lib/gitlab/client/commits.rb', line 97

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