MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getWorktreePathsPortable

Function getWorktreePathsPortable

src/utils/getWorktreePathsPortable.ts:12–27  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

10 * dependency chain (execa → cross-spawn → which).
11 */
12export async function getWorktreePathsPortable(cwd: string): Promise<string[]> {
13 try {
14 const { stdout } = await execFileAsync(
15 'git',
16 ['worktree', 'list', '--porcelain'],
17 { cwd, timeout: 5000 },
18 )
19 if (!stdout) return []
20 return stdout
21 .split('\n')
22 .filter(line => line.startsWith('worktree '))
23 .map(line => line.slice('worktree '.length).normalize('NFC'))
24 } catch {
25 return []
26 }
27}
28

Callers 3

gatherProjectCandidatesFunction · 0.85
resolveSessionFilePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected