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

Function blockRoots

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

The root each marker block in `content` names (null for an older block).

(content: string)

Source from the content-addressed store, hash-verified

155
156/** The root each marker block in `content` names (null for an older block). */
157function blockRoots(content: string): (string | null)[] {
158 const roots: (string | null)[] = [];
159 let current: string | null | undefined;
160 for (const line of content.split('\n')) {
161 const trimmed = line.trim();
162 if (trimmed === MARKER_BEGIN) { current = null; continue; }
163 if (current === undefined) continue;
164 if (trimmed.startsWith(ROOT_PREFIX)) { current = trimmed.slice(ROOT_PREFIX.length); continue; }
165 if (trimmed === MARKER_END) { roots.push(current); current = undefined; }
166 }
167 return roots;
168}
169
170/**
171 * Remove the marker blocks `owns` claims (and the blank line that follows

Callers 2

removeGitSyncHookFunction · 0.85
isSyncHookInstalledFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected