MCPcopy Create free account
hub / github.com/callstack/agent-device / findGitWorktreeRoot

Function findGitWorktreeRoot

src/daemon/session-routing.ts:85–95  ·  view source on GitHub ↗
(startDir: string)

Source from the content-addressed store, hash-verified

83}
84
85function findGitWorktreeRoot(startDir: string): string | undefined {
86 let current = startDir;
87 while (true) {
88 if (fs.existsSync(path.join(current, '.git'))) {
89 return current;
90 }
91 const parent = path.dirname(current);
92 if (parent === current) return undefined;
93 current = parent;
94 }
95}

Callers 1

resolveCallerScopeRootFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…