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

Function sameDirectory

src/sync/worktree.ts:201–203  ·  view source on GitHub ↗

* Whether two paths name one directory, however each is spelled. For * comparing only: the paths this module returns keep their own spelling. * * git answers with the on-disk spelling (a `subst` drive and links followed, * the case stored on disk), while callers hand in theirs: VS Code and Curso

(a: string, b: string)

Source from the content-addressed store, hash-verified

199 * falling back to the JS realpath where the native call fails.
200 */
201function sameDirectory(a: string, b: string): boolean {
202 return a === b || directoryIdentity(a) === directoryIdentity(b);
203}
204
205function directoryIdentity(p: string): string {
206 const real = nativeRealpath(p);

Callers 2

nestedRepositoryBelowFunction · 0.85

Calls 1

directoryIdentityFunction · 0.85

Tested by

no test coverage detected