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

Function ownerFor

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

* Which blocks belong to the project being installed / removed / checked: the * one naming its root, and — for the work tree's top-level project only — a * block from an older install, which named no root and so synced from the * directory git runs hooks in.

(projectRoot: string)

Source from the content-addressed store, hash-verified

144 * directory git runs hooks in.
145 */
146function ownerFor(projectRoot: string): BlockOwner {
147 const root = rootKey(projectRoot);
148 let toplevel: string | null | undefined;
149 return (blockRoot) => {
150 if (blockRoot !== null) return blockRoot === root;
151 if (toplevel === undefined) toplevel = gitToplevelKey(projectRoot);
152 return toplevel === root;
153 };
154}
155
156/** The root each marker block in `content` names (null for an older block). */
157function blockRoots(content: string): (string | null)[] {

Callers 3

installGitSyncHookFunction · 0.85
removeGitSyncHookFunction · 0.85
isSyncHookInstalledFunction · 0.85

Calls 2

rootKeyFunction · 0.85
gitToplevelKeyFunction · 0.85

Tested by

no test coverage detected