MCPcopy Create free account
hub / github.com/cloudflare/computer / fetchWith

Function fetchWith

packages/computer/src/git/network.ts:184–209  ·  view source on GitHub ↗
(opts: FetchWithDeps)

Source from the content-addressed store, hash-verified

182}
183
184export async function fetchWith(opts: FetchWithDeps): Promise<FetchResult> {
185 const dir = opts.dir ?? "/";
186 try {
187 return await opts.git.fetch({
188 fs: opts.fs,
189 http: opts.http,
190 dir,
191 url: opts.url,
192 remote: opts.remote,
193 ref: opts.ref,
194 remoteRef: opts.remoteRef,
195 depth: opts.depth,
196 singleBranch: opts.singleBranch,
197 tags: opts.tags,
198 prune: opts.prune,
199 headers: opts.headers,
200 onAuth: opts.onAuth,
201 onProgress: opts.onProgress,
202 onMessage: opts.onMessage,
203 cache: opts.cache,
204 });
205 } catch (cause) {
206 if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause });
207 throw new GitError("EFETCHFAIL", `git fetch failed: ${errorMessage(cause)}`, { cause });
208 }
209}
210
211// ---------------------------------------------------------------
212// push

Callers 2

network.test.tsFile · 0.85
fetchFunction · 0.85

Calls 3

isNotARepositoryCauseFunction · 0.85
errorMessageFunction · 0.70
fetchMethod · 0.65

Tested by

no test coverage detected