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

Function readGitTopLevel

src/node/services/projectService.ts:326–334  ·  view source on GitHub ↗
(projectPath: string)

Source from the content-addressed store, hash-verified

324}
325
326async function readGitTopLevel(projectPath: string): Promise<string | null> {
327 try {
328 using proc = execFileAsync("git", ["-C", projectPath, "rev-parse", "--show-toplevel"]);
329 const { stdout } = await proc.result;
330 return stripTrailingSlashes(stdout.trim());
331 } catch {
332 return null;
333 }
334}
335
336function findDeepestTopLevelParentProject(
337 candidatePath: string,

Callers 1

createMethod · 0.85

Calls 2

execFileAsyncFunction · 0.90
stripTrailingSlashesFunction · 0.90

Tested by

no test coverage detected