Skip to main content

Module worktree_remove_registry

Module worktree_remove_registry 

Source
Expand description

What: Which registration of the invoking repository a worktree directory belongs to, and whether Git would pick that same worktree for the name the person typed. Why: Git removes only a worktree that its own list for the repository it runs in contains, found first by the last components of every registered path and only then by the resolved path (find_worktree in Git’s worktree.c). The .git file of a worktree and the gitdir file of an administrative directory that name each other prove only that the pair is consistent, not that the repository the command runs in registered it, and a directory that exists under the typed name proves nothing about the worktree Git would remove for that name. Anything but a registration of the invoking repository that Git would also pick is left to Git, which words its own answer.

In TS you’d write (pseudocode):

const registration = registrationOf({ commonDir, target, operand }); // throws the reason Git must decide

Structs§

Registration
What: The registration of one linked worktree in the repository the command runs in. Why: The administrative directory is where the registration lives; its name is the worktree’s id.

Functions§

registration_of
What: The registration of target in the repository whose common Git directory is common_dir, when it is a linked worktree of that repository that Git would also pick for operand. Why: See the module description. The error is the reason, for the log; the removal is then left to Git.