fix: Pulling and pushing bug (#535)

This commit is contained in:
Brace Sproul 2025-07-25 15:46:26 -07:00 • committed by GitHub
parent 2d17904153
commit 248957ae62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -146,22 +146,26 @@ export async function checkoutBranchAndCommit(
}, },
{ retries: 3, delay: 0 }, { retries: 3, delay: 0 },
); );
const gitStatus = await sandbox.git.status(absoluteRepoDir); if (pushRes2 instanceof Error) {
const errorFields = { const gitStatus = await sandbox.git.status(absoluteRepoDir);
...(pushRes2 instanceof Error const errorFields = {
? { ...(pushRes2 instanceof Error
name: pushRes2.name, ? {
message: pushRes2.message, name: pushRes2.name,
stack: pushRes2.stack, message: pushRes2.message,
cause: pushRes2.cause, stack: pushRes2.stack,
} cause: pushRes2.cause,
: pushRes2), }
}; : pushRes2),
logger.error("Failed to push changes", { };
...errorFields, logger.error("Failed to push changes", {
gitStatus: JSON.stringify(gitStatus, null, 2), ...errorFields,
}); gitStatus: JSON.stringify(gitStatus, null, 2),
throw new Error("Failed to push changes"); });
throw new Error("Failed to push changes");
} else {
logger.info("Pulling changes before pushing succeeded");
}
} else { } else {
logger.info("Successfully pushed changes"); logger.info("Successfully pushed changes");
} }