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

Function remoteAddWith

packages/computer/src/git/network.ts:440–456  ·  view source on GitHub ↗
(opts: RemoteAddWithDeps)

Source from the content-addressed store, hash-verified

438}
439
440export async function remoteAddWith(opts: RemoteAddWithDeps): Promise<void> {
441 const dir = opts.dir ?? "/";
442 try {
443 await opts.git.addRemote({
444 fs: opts.fs,
445 dir,
446 remote: opts.name,
447 url: opts.url,
448 force: opts.force,
449 });
450 } catch (cause) {
451 if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause });
452 throw new GitError("EREMOTEFAIL", `git remote add failed: ${errorMessage(cause)}`, {
453 cause,
454 });
455 }
456}
457
458export interface GitRemoteRemoveOptions {
459 dir?: string;

Callers 2

network.test.tsFile · 0.85
remoteAddFunction · 0.85

Calls 3

isNotARepositoryCauseFunction · 0.85
addRemoteMethod · 0.80
errorMessageFunction · 0.70

Tested by

no test coverage detected