Skip to main content

Module conflict

Module conflict 

Source
Expand description

Shared CLI helpers for the resolvable-conflict workflow (#177).

Materialises conflict material into the worktree + index, classifies each conflict into a presentation class, and scans for leftover conflict markers so --continue can refuse to proceed while the user has not resolved a textual conflict.

Materialisation always honours the #176 restore guards: callers run super::ensure_restore_safe over the conflict-time tree before invoking materialize_conflicts, so dirty tracked files and untracked collisions are never clobbered.

Enums§

ConflictClass
Classification of how a conflicting path is presented to the user.

Functions§

classify
Classify a single conflict given its blob contents.
ensure_abort_safe
Pre-abort safety gate: refuse the abort before it mutates anything when restoring to target_tree would overwrite genuine user work on a path that is not part of the recorded conflict set.
ensure_conflict_paths_staged
Refuse --continue when a conflicted path’s worktree resolution does not match what is staged in the index. The final tree is built from the index, so any unstaged resolution would be silently dropped and then overwritten by the worktree restore (#269).
first_unresolved_marker
materialize_conflicts
Materialise every conflict into the worktree and stage the ours-side blob into the index so each conflicting path is “resolvable”:
reset_conflict_paths
Discard conflict material on the recorded conflict paths, resetting each back to its content in target_tree (the pre-op HEAD): write the target blob into the worktree (or delete the file when the path is absent from target_tree) and align the index entry.