MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isSameIndexRoot

Function isSameIndexRoot

src/directory.ts:353–364  ·  view source on GitHub ↗
(a: string, b: string)

Source from the content-addressed store, hash-verified

351 * has no usable inode, so it compares the on-disk-cased native realpaths.
352 */
353export function isSameIndexRoot(a: string, b: string): boolean {
354 if (a === b) return true;
355 if (process.platform === 'win32') {
356 try {
357 return fs.realpathSync.native(getCodeGraphDir(a)) === fs.realpathSync.native(getCodeGraphDir(b));
358 } catch {
359 return false;
360 }
361 }
362 const id = statInode(getCodeGraphDir(a));
363 return id !== null && id === statInode(getCodeGraphDir(b));
364}
365
366export function findNearestCodeGraphRoot(startPath: string): string | null {
367 let current = path.resolve(startPath);

Callers 2

openProjectRootMethod · 0.90

Calls 2

getCodeGraphDirFunction · 0.85
statInodeFunction · 0.85

Tested by

no test coverage detected