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

Function readTrunkBranch

scripts/reproWorkspaceSwitchTearWeb.ts:98–108  ·  view source on GitHub ↗
(projectPath: string)

Source from the content-addressed store, hash-verified

96}
97
98function readTrunkBranch(projectPath: string): string {
99 const result = Bun.spawnSync(["git", "rev-parse", "--abbrev-ref", "HEAD"], {
100 cwd: projectPath,
101 stdout: "pipe",
102 stderr: "pipe",
103 });
104 if (result.exitCode !== 0) {
105 throw new Error(`Failed to detect trunk branch: ${result.stderr.toString()}`);
106 }
107 return result.stdout.toString().trim();
108}
109
110async function createWorkspaceViaOrpc(args: {
111 page: Page;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected