MCPcopy Index your code
hub / github.com/inkeep/open-knowledge / isInsideExistingWorkTree

Function isInsideExistingWorkTree

packages/server/src/project-git.ts:31–40  ·  view source on GitHub ↗
(gitBin: string, cwd: string)

Source from the content-addressed store, hash-verified

29}
30
31async function isInsideExistingWorkTree(gitBin: string, cwd: string): Promise<boolean> {
32 try {
33 const { stdout } = await execFileAsync(gitBin, ['rev-parse', '--is-inside-work-tree'], {
34 cwd,
35 });
36 return stdout.trim() === 'true';
37 } catch {
38 return false;
39 }
40}
41
42export async function ensureProjectGit(projectRoot: string): Promise<EnsureProjectGitResult> {
43 const abs = resolve(projectRoot);

Callers 1

ensureProjectGitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected