MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / getGitRoot

Function getGitRoot

projects/electron/src/modules/code/files.ts:153–156  ·  view source on GitHub ↗

* Get git repo root from a directory

(dir: string)

Source from the content-addressed store, hash-verified

151 * Get git repo root from a directory
152 */
153async function getGitRoot(dir: string): Promise<string | null> {
154 const result = await execCmd("git", ["rev-parse", "--show-toplevel"], dir)
155 return result.success ? result.stdout.trim() : null
156}
157
158/**
159 * Get the relative path from git root to dir

Callers 1

listFilesWithGitFunction · 0.85

Calls 1

execCmdFunction · 0.85

Tested by

no test coverage detected