Method: projects.locations.connections.gitRepositoryLinks.fetchCommit

Fetch Commit details from a Git repository link.

HTTP request

GET https://developerconnect.googleapis.com/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchCommit

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The resource name of the GitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

Query parameters

Parameters
commitSha

string

Required. The commit SHA, or symbolic revision (for example, branch name, tag, or Git reference).

view

enum (CommitView)

Optional. The level of commit details to return in the response. Defaults to FULL if unspecified. In FULL view, files metadata (paths and statuses) are returned; pathFilters must also be specified to populate line patch hunks.

pathFilters[]

string

Optional. Path patterns or exact paths to filter returned files (only applicable in FULL view). When pathFilters is specified, FileDiff.patch is populated for all matching files (use ["**"] to include patches for all changed files). When pathFilters is omitted or empty, the full list of FileDiff is returned without patch diffs (FileDiff.patch is empty).

Request body

The request body must be empty.

Response body

Response message for gitRepositoryLinks.fetchCommit.

If successful, the response body contains data with the following structure:

JSON representation
{
  "commit": {
    object (SCMCommit)
  },
  "files": [
    {
      object (FileDiff)
    }
  ]
}
Fields
commit

object (SCMCommit)

The commit metadata.

files[]

object (FileDiff)

List of file changes and patch diffs. Omitted when view is BASIC. Patch diffs (FileDiff.patch) are only populated when pathFilters is specified in the request.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • developerconnect.gitRepositoryLinks.fetchCommit

For more information, see the IAM documentation.