Skip to main content

Module shadow_config

Module shadow_config 

Source
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§

RepositoryFormat
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 config file. 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 --list reads only that file, so an included or worktree config never leaks into the copied format.