Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.5 kB · 42 lines
Swift
12345678910111213141516171819202122232425262728293031323334353637383940414243import Dependenciesimport DependenciesMacrosimport Foundation
@DependencyClientpublic struct SourceControlClient: Sendable { public var clone: @Sendable (CloneRequest) async throws -> Repository public var open: @Sendable (URL) async throws -> Repository public var fetch: @Sendable (FetchRequest) async throws -> Void public var checkout: @Sendable (CheckoutRequest) async throws -> Void public var resolveRevision: @Sendable (ResolveRevisionRequest) async throws -> CommitID public var createBranch: @Sendable (CreateBranchRequest) async throws -> Branch public var status: @Sendable (Repository) async throws -> [StatusEntry] public var stage: @Sendable (StageRequest) async throws -> Void public var commit: @Sendable (CommitRequest) async throws -> Commit public var formatPatch: @Sendable (FormatPatchRequest) async throws -> Data public var emailPatch: @Sendable (EmailPatchRequest) async throws -> Data public var push: @Sendable (PushRequest) async throws -> Void}
public extension SourceControlClient { static var unimplemented: Self { Self() }}
public extension DependencyValues { var sourceControl: SourceControlClient { get { self[SourceControlClientKey.self] } set { self[SourceControlClientKey.self] = newValue } }}
private enum SourceControlClientKey: DependencyKey { static var liveValue: SourceControlClient { .unimplemented }
static var testValue: SourceControlClient { .unimplemented }}