Ensure git repo is in a clean state.
()
| 337 | |
| 338 | |
| 339 | def check_git_status(): |
| 340 | """Ensure git repo is in a clean state.""" |
| 341 | print("🔍 Checking git status...") |
| 342 | |
| 343 | # Check if we're in a git repo |
| 344 | try: |
| 345 | run_cmd("git status", capture_output=True) |
| 346 | except subprocess.CalledProcessError: |
| 347 | sys.exit("❌ Not in a git repository") |
| 348 | |
| 349 | # Check for uncommitted changes |
| 350 | status = run_cmd("git status --porcelain", capture_output=True) |
| 351 | if status: |
| 352 | print("❌ You have uncommitted changes:") |
| 353 | print(status) |
| 354 | sys.exit("Please commit or stash your changes before releasing") |
| 355 | |
| 356 | print("✅ Git status is clean") |
| 357 | |
| 358 | |
| 359 | def ensure_main_branch(): |