MCPcopy
hub / github.com/coder/mux / resolveCheckedOutBranch

Method resolveCheckedOutBranch

src/node/runtime/SSHRuntime.ts:1500–1520  ·  view source on GitHub ↗
(
    workspacePath: string,
    abortSignal?: AbortSignal,
    timeout = 10
  )

Source from the content-addressed store, hash-verified

1498 }
1499
1500 private async resolveCheckedOutBranch(
1501 workspacePath: string,
1502 abortSignal?: AbortSignal,
1503 timeout = 10
1504 ): Promise<string | null> {
1505 try {
1506 const branchResult = await execBuffered(
1507 this,
1508 `git -C ${this.quoteForRemote(workspacePath)} branch --show-current`,
1509 {
1510 cwd: "/tmp",
1511 timeout,
1512 abortSignal,
1513 }
1514 );
1515 const branchName = branchResult.stdout.trim();
1516 return branchResult.exitCode === 0 && branchName.length > 0 ? branchName : null;
1517 } catch {
1518 return null;
1519 }
1520 }
1521
1522 /**
1523 * Resolve the bundle staging ref for the trunk branch.

Callers 2

deleteWorkspaceMethod · 0.95
forkWorkspaceMethod · 0.95

Calls 2

quoteForRemoteMethod · 0.95
execBufferedFunction · 0.90

Tested by

no test coverage detected