diff options
| author | tv <tv@krebsco.de> | 2026-11-13 03:41:54 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-13 03:41:54 +0000 |
| commit | 4ee857a9f1c9153b944a2f48a89f35d9657b2ca5 (patch) | |
| tree | 039561c3e3c39faf1670ad05b11c600468b3817c /flake.nix | |
| parent | 3219e04ce4ff01b5f013e89d6245af9d28d73814 (diff) | |
populate git: refuse work trees whose .git names places elsewhere
A .git directory names places elsewhere in more ways than being a
symlink or a file: core.worktree, symlinks to a configuration, to
objects, or to refs elsewhere, a commondir file naming another
repository, and linked work trees. Git's commands follow them, so
fetching, resetting, setting the remote's URL, and cleaning change what
is elsewhere: with core.worktree, git clean removes everything in the
work tree it names. And Git runs commands the configuration names, like
core.fsmonitor, and hooks.
Populate only uses a work tree whose .git directory has no symlinks, no
commondir file, no linked work trees, and only configuration that git
clone and populate write, where submodules' repositories may have their
work tree in the work tree. Otherwise populating fails with an error
telling what's wrong, unless the new option reclone replaces the work
tree by a fresh clone. Git runs without hooks and without fsmonitor in
any case.
The work tree also gets reset to the commit if HEAD is there already: a
lock file rewritten in place, or created and staged by Nix, stays
otherwise once the source stops drawing inputs.
A safety scenario refuses work trees with core.worktree, a symlinked
configuration, a commondir file, and core.fsmonitor, replaces them with
reclone, and checks that a hook doesn't run. A git scenario stops
drawing inputs and checks that the work tree is clean.
Diffstat (limited to 'flake.nix')
0 files changed, 0 insertions, 0 deletions
