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

Function isGitRepository

src/node/utils/pathUtils.ts:101–109  ·  view source on GitHub ↗
(projectPath: string)

Source from the content-addressed store, hash-verified

99 * @returns true if the path contains a .git directory
100 */
101export async function isGitRepository(projectPath: string): Promise<boolean> {
102 const gitPath = path.join(projectPath, ".git");
103 try {
104 await fs.stat(gitPath);
105 return true;
106 } catch {
107 return false;
108 }
109}
110
111/**
112 * Check whether `projectPath` lies inside a git work tree, even if `.git`

Callers 5

pathUtils.test.tsFile · 0.90
gitInitMethod · 0.90
ensureReadyMethod · 0.90
ensureReadyMethod · 0.90

Calls 1

statMethod · 0.65

Tested by

no test coverage detected