Skip to main content

git_states_in_progress

Function git_states_in_progress 

Source
pub fn git_states_in_progress() -> Vec<GitState>
Expand description

Which git operations are part-way through, from the markers in $GIT_DIR.

Asks git directly rather than deriving a path from hooks_dir. That used to be hooks_dir.parent() — correct for the main worktree, where hooks live in .git/hooks and .git IS $GIT_DIR, but wrong for a LINKED worktree: hooks dispatch from the COMMON directory’s hooks/, shared across every worktree, while MERGE_HEAD/CHERRY_PICK_HEAD/etc. live in each worktree’s own PRIVATE gitdir under .git/worktrees/<name>. Conflating the two silently disabled this guard for every linked worktree — the same mistake staged_only’s store path made, which lost unstaged work outright; see its module doc.