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

Function rootKey

src/sync/git-hooks.ts:93–101  ·  view source on GitHub ↗

* The key a block records for its project: the resolved root with forward * slashes, which Git for Windows' sh also accepts.

(projectRoot: string)

Source from the content-addressed store, hash-verified

91 * slashes, which Git for Windows' sh also accepts.
92 */
93function rootKey(projectRoot: string): string {
94 let resolved = path.resolve(projectRoot);
95 try {
96 resolved = fs.realpathSync(resolved);
97 } catch {
98 /* keep the lexical path when it can't be resolved */
99 }
100 return resolved.split(path.sep).join('/');
101}
102
103/** The work tree's top level (as a {@link rootKey}), or null when unknown. */
104function gitToplevelKey(projectRoot: string): string | null {

Callers 3

gitToplevelKeyFunction · 0.85
ownerForFunction · 0.85
installGitSyncHookFunction · 0.85

Calls 2

resolveMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected