Table of Contents

Class GitClient

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

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public class GitClient : IGitClient
Inheritance
GitClient
Implements
Inherited Members

Methods

GetConfig()

Gets the effective Git configuration without secrets.

public GitConfigResponse GetConfig()

Returns

GitConfigResponse

GetConfigAsync(CancellationToken)

Gets the effective Git configuration without secrets.

public 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.

public IReadOnlyList<GitDiffFile> GetDiff(string commitSha)

Parameters

commitSha string

Returns

IReadOnlyList<GitDiffFile>

GetDiffAsync(string, CancellationToken)

Gets file-level changes for a commit.

public 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.

public IReadOnlyList<GitHistoryEntry> GetHistory()

Returns

IReadOnlyList<GitHistoryEntry>

GetHistoryAsync(CancellationToken)

Gets the configuration history.

public 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.

public GitStatusResponse GetStatus()

Returns

GitStatusResponse

GetStatusAsync(CancellationToken)

Gets the current Git status.

public 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.

public GitRestoreResponse Restore(GitRestoreRequest request)

Parameters

request GitRestoreRequest

Returns

GitRestoreResponse

RestoreAsync(GitRestoreRequest, CancellationToken)

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

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

Parameters

request GitRestoreRequest
cancellationToken CancellationToken

The token to cancel the current operation.

Returns

Task<GitRestoreResponse>