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

Function remoteListWith

packages/computer/src/git/network.ts:494–505  ·  view source on GitHub ↗
(opts: RemoteListWithDeps)

Source from the content-addressed store, hash-verified

492}
493
494export async function remoteListWith(opts: RemoteListWithDeps): Promise<RemoteView[]> {
495 const dir = opts.dir ?? "/";
496 try {
497 const remotes = await opts.git.listRemotes({ fs: opts.fs, dir });
498 return remotes.map((r) => ({ name: r.remote, url: r.url }));
499 } catch (cause) {
500 if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause });
501 throw new GitError("EREMOTEFAIL", `git remote failed: ${errorMessage(cause)}`, {
502 cause,
503 });
504 }
505}
506
507function errorMessage(cause: unknown): string {
508 if (cause instanceof Error) return cause.message;

Callers 2

network.test.tsFile · 0.85
remoteListFunction · 0.85

Calls 3

isNotARepositoryCauseFunction · 0.85
listRemotesMethod · 0.80
errorMessageFunction · 0.70

Tested by

no test coverage detected