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

Function isSameIndexRoot

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

Source from the content-addressed store, hash-verified

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

Callers 2

openProjectRootMethod · 0.90

Calls 2

getCodeGraphDirFunction · 0.85
statInodeFunction · 0.85

Tested by

no test coverage detected