Expand description
Pure core of the merge, cherry-pick and revert conclusion check. What: The pure core of the “is a merge, cherry-pick or revert awaiting its commit” check. Why: The caller runs real Git and probes the filesystem; this module says which query to run, reads its output exactly, and decides from three presence facts.
In TS you’d write (pseudocode):
// sequencerState({ mergeHead, cherryPickHead, revertHead }): 'in-progress' | 'none'Structs§
- Sequencer
Facts - What:
Existence of each head file,
as the caller observed it.
boolis true or false. Why: These three facts are everything the decision needs from the repository. - Sequencer
Output Error - What: Why the path query’s output could not be read. Why: Output that is not exactly three paths in one directory is reported, never guessed.
Enums§
- Sequencer
State - What:
Whether an operation is awaiting its concluding commit.
Why:
While one is,
Git forbids partial commits,
so a pathless
git commitis the documented conclusion and the commit-only transform lets it through.
Constants§
- SEQUENCER_
HEAD_ FILES - Git-directory files whose presence marks an operation awaiting its concluding commit.
Functions§
- sequencer_
head_ paths - What:
Read the query output as three paths without splitting on newlines.
Result<Vec<Vec<u8>>, _>is “three byte paths, or a refusal”. Why: A Git directory path may contain a newline. The three files share one directory, so its length follows from the output length and the result is checked byte for byte. - sequencer_
query_ arguments - What:
Build the real-Git argument list:
the caller’s global options,
then one
--git-pathper head file.Vec<OsString>is the owned result. Why:--git-pathresolves linked worktrees andGIT_DIR, which a lexical join cannot. - sequencer_
state - What: Decide from the three presence facts. Why: Any one head file means Git is waiting for the concluding commit.
- sequencer_
state_ when_ query_ fails - What: The state to use when the path query itself failed. Why: The incumbent falls back to normal enforcement and lets real Git report its error.