diff --git a/src/git/http.ts b/src/git/http.ts index f133c2fae..1f1b7d6b8 100644 --- a/src/git/http.ts +++ b/src/git/http.ts @@ -140,7 +140,7 @@ async function* advertiseRefGenerator({ // "0000" yield gitUtils.FLUSH_PACKET_BUFFER; // Ref_list - yield* referenceList(objectGenerator, capabilityList); + yield* referenceListGenerator(objectGenerator, capabilityList); // "0000" yield gitUtils.FLUSH_PACKET_BUFFER; } @@ -161,7 +161,7 @@ async function* advertiseRefGenerator({ * cap-list = capability *(SP capability) * ``` */ -async function* referenceList( +async function* referenceListGenerator( objectGenerator: AsyncGenerator<[Reference, ObjectId], void, void>, capabilities: CapabilityList, ): AsyncGenerator { diff --git a/src/vaults/VaultInternal.ts b/src/vaults/VaultInternal.ts index 448618796..2575144cc 100644 --- a/src/vaults/VaultInternal.ts +++ b/src/vaults/VaultInternal.ts @@ -766,6 +766,43 @@ class VaultInternal { return commitIdLatest; } + /** + * Creates a request arrow function that implements an api that `isomorphic-git` expects to use when making a http + * request. It makes RPC calls to `vaultsGitInfoGet` for the ref advertisement phase and `vaultsGitPackGet` for the + * git pack phase. + * + * `vaultsGitInfoGet` wraps a call to `gitHttp.advertiseRefGenerator` and `vaultsGitPackGet` to + * `gitHttp.generatePackRequest`. + * + * ``` + * ┌─────────┐ ┌───────────────────────────┐ + * │ │ │ │ + * ┌──────────────────────┐ │ RPC │ │ │ + * │ │ │ │ │ *advertiseRefGenerator() │ + * │ ├────────┼─────────┼────► │ + * │ vault.request() │ │ │ │ │ + * │ │ │ │ └────┬──────────────────────┘ + * │ ├──┐ │ │ │ + * │ │ │ │ │ ┌────▼──────────────────────┐ + * └──────────────────────┘ │ │ │ │ │ + * │ │ │ │ *referenceListGenerator() │ + * │ │ │ │ │ + * │ │ │ └───────────────────────────┘ + * │ │ │ + * │ │ │ ┌───────────────────────────┐ + * └─────┼─────────┼────┤ │ + * │ │ │ *generatePackRequest() │ + * │ │ │ │ + * │ │ └────┬──────────────────────┘ + * └─────────┘ │ + * ┌────▼──────────────────────┐ + * │ │ + * │ *generatePackData() │ + * │ │ + * └───────────────────────────┘ + * + * ``` + */ protected async request( client: RPCClient, vaultNameOrId: VaultId | VaultName,