upsertShepherdIgnoreBlock
upsertShepherdIgnoreBlock(
existing):object
Defined in: src/shepherd-exclude.ts:40
Insert or replace the managed shepherd:ignore block in gitignore-syntax
content. Idempotent: replaces an existing managed block’s contents rather
than appending a duplicate; treats a pre-existing bare .shepherd-* line
(the glob already present outside the markers) as already-covered → no-op;
otherwise appends a fresh block.
Generic over the target file — used for BOTH .git/info/exclude (via
ensureShepherdExclude) and a committed .gitignore (via GitignoreAdopter),
which share the same gitignore glob syntax + managed-block markers.
Modelled on upsertLearningsBlock in src/promote.ts.
Parameters
Section titled “Parameters”existing
Section titled “existing”string
Returns
Section titled “Returns”object
changed
Section titled “changed”changed:
boolean
content
Section titled “content”content:
string