Skip to content

new_feature.dirty_target

new_feature.dirty_target

Set aside an unrelated dirty target checkout during merge --ignore-dirty.

uncommitted_changes_set_aside(root: Path, *, purpose: str) -> Iterator[None]

Stash uncommitted changes, including untracked files, and restore them afterwards.

Restoring runs on success and failure. When the stash cannot be applied cleanly, it stays on the stash stack and the error names its commit.

ensure_changes_clear_of_merge(root: Path, *, branch: str, target_branch: str, fetch: bool, local_files: tuple[Path, ...]) -> None

Refuse when uncommitted changes touch paths the merge or local file copies would change.

This mirrors git merge with a dirty checkout, so restoring stashed changes after the merge does not conflict.