Browse Source

chore: Improve script robustness

The script now includes checks for a clean working directory before proceeding.  This prevents accidental modifications to the repository during rebase operations.
seno 1 week ago
parent
commit
f6fd73b66e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      git_rebase_ai.py

+ 3 - 0
git_rebase_ai.py

@@ -1548,6 +1548,9 @@ def main():
         logging.error("This script must be run from within a Git repository.")
         sys.exit(1)
 
+    if not check_git_status():
+        sys.exit(1)  # Exit if working directory is not clean
+
     # Handle --delete-backups flag first
     if args.delete_backups:
         current_branch = get_current_branch()