MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / ensure_clean_worktree

Function ensure_clean_worktree

scripts/prepare_release.py:79–91  ·  view source on GitHub ↗

Ensure the release starts from a clean worktree. Raises: ReleaseError: The repository contains tracked or untracked changes.

()

Source from the content-addressed store, hash-verified

77
78
79def ensure_clean_worktree() -> None:
80 """Ensure the release starts from a clean worktree.
81
82 Raises:
83 ReleaseError: The repository contains tracked or untracked changes.
84 """
85 status = git(["status", "--porcelain"], capture_output=True)
86 if status:
87 raise ReleaseError(
88 "Working tree must be clean before preparing a release.\n"
89 "Commit, stash, or remove these changes first:\n"
90 f"{status}"
91 )
92
93
94def validate_version(version: str) -> str:

Callers 1

mainFunction · 0.85

Calls 2

gitFunction · 0.85
ReleaseErrorClass · 0.85

Tested by

no test coverage detected