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

Function stripMarkerBlock

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

Remove our marker block (and the marker lines) from hook content.

(content: string)

Source from the content-addressed store, hash-verified

89
90/** Remove our marker block (and the marker lines) from hook content. */
91function stripMarkerBlock(content: string): string {
92 const lines = content.split('\n');
93 const kept: string[] = [];
94 let inBlock = false;
95 for (const line of lines) {
96 const trimmed = line.trim();
97 if (trimmed === MARKER_BEGIN) { inBlock = true; continue; }
98 if (trimmed === MARKER_END) { inBlock = false; continue; }
99 if (!inBlock) kept.push(line);
100 }
101 return kept.join('\n');
102}
103
104/** Whether a hook body is just a shebang / blank lines (i.e. only ever ours). */
105function isEffectivelyEmpty(content: string): boolean {

Callers 2

installGitSyncHookFunction · 0.85
removeGitSyncHookFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected