MCPcopy Create free account
hub / github.com/coder/mux / refreshBaseRepoOrigin

Method refreshBaseRepoOrigin

src/node/runtime/SSHRuntime.ts:1644–1661  ·  view source on GitHub ↗
(
    projectPath: string,
    baseRepoPathArg: string,
    initLogger: InitLogger,
    abortSignal?: AbortSignal
  )

Source from the content-addressed store, hash-verified

1642 }
1643
1644 private async refreshBaseRepoOrigin(
1645 projectPath: string,
1646 baseRepoPathArg: string,
1647 initLogger: InitLogger,
1648 abortSignal?: AbortSignal
1649 ): Promise<void> {
1650 const { originUrl } = await this.getOriginUrlForSync(projectPath, initLogger);
1651 if (!originUrl) {
1652 return;
1653 }
1654
1655 initLogger.logStep(`Setting origin remote to ${originUrl}...`);
1656 await execBuffered(
1657 this,
1658 `git -C ${baseRepoPathArg} remote set-url origin ${shescape.quote(originUrl)} 2>/dev/null || git -C ${baseRepoPathArg} remote add origin ${shescape.quote(originUrl)}`,
1659 { cwd: "/tmp", timeout: 10, abortSignal }
1660 );
1661 }
1662
1663 /**
1664 * Pre-fetch from origin on the remote host to reduce local→remote push size.

Callers 2

Calls 3

getOriginUrlForSyncMethod · 0.95
execBufferedFunction · 0.90
logStepMethod · 0.80

Tested by

no test coverage detected