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

Method writeWorkspaceBranchMap

src/node/worktree/WorktreeManager.ts:688–698  ·  view source on GitHub ↗
(
    projectPath: string,
    branchMap: Record<string, string>
  )

Source from the content-addressed store, hash-verified

686 }
687
688 private async writeWorkspaceBranchMap(
689 projectPath: string,
690 branchMap: Record<string, string>
691 ): Promise<void> {
692 const branchMapPath = await this.getWorkspaceBranchMapPath(projectPath);
693 if (Object.keys(branchMap).length === 0) {
694 await fsPromises.rm(branchMapPath, { force: true });
695 return;
696 }
697 await fsPromises.writeFile(branchMapPath, `${JSON.stringify(branchMap, null, 2)}\n`);
698 }
699
700 private async getWorkspaceBranchMapPath(projectPath: string): Promise<string> {
701 const gitPath = path.join(projectPath, ".git");

Calls 2

writeFileMethod · 0.65

Tested by

no test coverage detected