chore: 🔧 Update files
This commit is contained in:
parent
099ea4e71d
commit
b410f600bb
1 changed files with 16 additions and 0 deletions
|
|
@ -215,6 +215,22 @@ class PushCommitStage(PipelineStage):
|
|||
if "rejected" in error_msg or "non-fast-forward" in error_msg:
|
||||
raise PushRejectedError(f"Push rejected: {e.stderr}")
|
||||
|
||||
# Check if remote doesn't exist or branch doesn't match
|
||||
if ("does not appear to be a git repository" in error_msg or
|
||||
"could not read from remote repository" in error_msg or
|
||||
"src refspec" in error_msg and "does not match any" in error_msg):
|
||||
logger.warning(f"Remote not configured properly, attempting auto-setup")
|
||||
if await self._setup_remote_if_missing(repo_path, remote, branch):
|
||||
# Retry push after setup
|
||||
result = subprocess.run(
|
||||
["git", "push", "-u", remote, branch],
|
||||
cwd=repo_path,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True,
|
||||
)
|
||||
return # Success after setup
|
||||
|
||||
raise Exception(f"Push failed: {e.stderr}")
|
||||
|
||||
async def _pull_rebase(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue