chore: update ui service manager of new service

This commit is contained in:
Benjamin Labrecque
2026-07-09 14:46:14 +02:00
parent 3f7f392de0
commit 589ae5c097
+15 -3
View File
@@ -48,9 +48,21 @@ def git_push_changes(
origin = repo.remote(name="origin")
origin.push(refspec=f"{branch_name}:{branch_name}").raise_if_error()
except Exception as e:
logger.info("Git resetting files")
repo.index.reset(files_to_stage)
raise e
logger.error(f"Push failed due to an error: {e}")
logger.info("Rolling back local Git index changes...")
# Step A: Undo the local commit if it was created (moves HEAD back 1 commit, keeps changes)
# This prevents leaving a dead/unpushed commit on your local branch
try:
repo.head.reset("HEAD~1", index=True, working_tree=False)
except Exception:
# Fallback if the exception happened BEFORE the commit step even ran
pass
# Step B: Unstage the specific files (Equivalent to: git reset HEAD <files>)
# This leaves the files intact but removes them from the staging area
repo.index.reset(paths=files_to_stage)
logger.info("Staging area successfully reset to clean state.")
logger.info("Successfully pushed!")