Table of Contents

Interface IGitClient

Namespace
Nexus.Api.V1
Assembly
Nexus.Api.dll

Provides methods to interact with git.

public interface IGitClient

Methods

GetConfig()

Gets the effective Git configuration without secrets.

GitConfigResponse GetConfig()

Returns

GitConfigResponse

GetConfigAsync(CancellationToken)

Gets the effective Git configuration without secrets.

Task<GitConfigResponse> GetConfigAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token to cancel the current operation.

Returns

Task<GitConfigResponse>

GetDiff(string)

Gets file-level changes for a commit.

IReadOnlyList<GitDiffFile> GetDiff(string commitSha)

Parameters

commitSha string

Returns

IReadOnlyList<GitDiffFile>

GetDiffAsync(string, CancellationToken)

Gets file-level changes for a commit.

Task<IReadOnlyList<GitDiffFile>> GetDiffAsync(string commitSha, CancellationToken cancellationToken = default)

Parameters

commitSha string
cancellationToken CancellationToken

The token to cancel the current operation.

Returns

Task<IReadOnlyList<GitDiffFile>>

GetHistory()

Gets the configuration history.

IReadOnlyList<GitHistoryEntry> GetHistory()

Returns

IReadOnlyList<GitHistoryEntry>

GetHistoryAsync(CancellationToken)

Gets the configuration history.

Task<IReadOnlyList<GitHistoryEntry>> GetHistoryAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token to cancel the current operation.

Returns

Task<IReadOnlyList<GitHistoryEntry>>

GetStatus()

Gets the current Git status.

GitStatusResponse GetStatus()

Returns

GitStatusResponse

GetStatusAsync(CancellationToken)

Gets the current Git status.

Task<GitStatusResponse> GetStatusAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The token to cancel the current operation.

Returns

Task<GitStatusResponse>

Restore(GitRestoreRequest)

Restores the configuration from a commit by creating a new commit.

GitRestoreResponse Restore(GitRestoreRequest request)

Parameters

request GitRestoreRequest

Returns

GitRestoreResponse

RestoreAsync(GitRestoreRequest, CancellationToken)

Restores the configuration from a commit by creating a new commit.

Task<GitRestoreResponse> RestoreAsync(GitRestoreRequest request, CancellationToken cancellationToken = default)

Parameters

request GitRestoreRequest
cancellationToken CancellationToken

The token to cancel the current operation.

Returns

Task<GitRestoreResponse>