Expand description
The shadow repository config file and the copied repository format.
What:
The shadow repository’s config file, written by cli-git itself,
and the repository format facts it copies from the real common config.
Why:
Git does not apply core.repositoryformatversion and extensions.* from an included file,
so they are copied explicitly.
core.hooksPath precedes the include so a real core.hooksPath still overrides it;
core.worktree, gc.auto and maintenance.auto follow it,
so the real config cannot redirect the worktree or start maintenance in the shadow
(src/shadow-repository/shadow-config.ts).
In TS you’d write (pseudocode):
formatShadowConfig({ format, commonDir, worktreeRoot });Structs§
- Repository
Format - What: Repository format facts the shadow copies from the real common config. Why: A shadow with a different object format or ref backend would misread the real store.
Functions§
- format_
shadow_ config - What:
Formats the shadow
configfile. Why: The line order is the incumbent’s: hooks path before the include, then the worktree, gc and maintenance overrides. - quote_
git_ config_ value - What:
Quotes one value under Git’s config syntax.
Why:
The value is always double-quoted,
so
;,#and surrounding whitespace stay literal; backslash, double quote, newline and tab use Git’s escapes. - read_
repository_ format - What:
Reads the format facts from the real common config file alone.
Why:
git config --file config --listreads only that file, so an included or worktree config never leaks into the copied format.