MCPcopy Index your code
hub / github.com/Waishnav/devspace / managedWorktreePath

Function managedWorktreePath

src/git-worktrees.ts:149–153  ·  view source on GitHub ↗
(input: { worktreeRoot: string; repoRoot: string })

Source from the content-addressed store, hash-verified

147}
148
149function managedWorktreePath(input: { worktreeRoot: string; repoRoot: string }): string {
150 const repoName = sanitizePathSegment(basename(input.repoRoot)) || "repo";
151 const worktreeId = randomBytes(4).toString("hex");
152 return join(input.worktreeRoot, `${repoName}-${worktreeId}`);
153}
154
155function sanitizePathSegment(value: string): string {
156 return value

Callers 1

createManagedWorktreeFunction · 0.85

Calls 1

sanitizePathSegmentFunction · 0.85

Tested by

no test coverage detected