MCPcopy Create free account
hub / github.com/Noumena-Network/code / createFindCanonicalGitRoot

Function createFindCanonicalGitRoot

src/utils/git.ts:198–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196export const findCanonicalGitRoot = createFindCanonicalGitRoot()
197
198function createFindCanonicalGitRoot(): {
199 (startPath: string): string | null
200 cache: typeof resolveCanonicalRoot.cache
201} {
202 function wrapper(startPath: string): string | null {
203 const root = findGitRoot(startPath)
204 if (!root) {
205 return null
206 }
207 return resolveCanonicalRoot(root)
208 }
209 wrapper.cache = resolveCanonicalRoot.cache
210 return wrapper
211}
212
213export const gitExe = memoize((): string => {
214 // Every time we spawn a process, we have to lookup the path.

Callers 1

git.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected