mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 10:23:14 +00:00
fix: Pulling and pushing bug (#535)
This commit is contained in:
parent
2d17904153
commit
248957ae62
1 changed files with 20 additions and 16 deletions
|
|
@ -146,22 +146,26 @@ export async function checkoutBranchAndCommit(
|
|||
},
|
||||
{ retries: 3, delay: 0 },
|
||||
);
|
||||
const gitStatus = await sandbox.git.status(absoluteRepoDir);
|
||||
const errorFields = {
|
||||
...(pushRes2 instanceof Error
|
||||
? {
|
||||
name: pushRes2.name,
|
||||
message: pushRes2.message,
|
||||
stack: pushRes2.stack,
|
||||
cause: pushRes2.cause,
|
||||
}
|
||||
: pushRes2),
|
||||
};
|
||||
logger.error("Failed to push changes", {
|
||||
...errorFields,
|
||||
gitStatus: JSON.stringify(gitStatus, null, 2),
|
||||
});
|
||||
throw new Error("Failed to push changes");
|
||||
if (pushRes2 instanceof Error) {
|
||||
const gitStatus = await sandbox.git.status(absoluteRepoDir);
|
||||
const errorFields = {
|
||||
...(pushRes2 instanceof Error
|
||||
? {
|
||||
name: pushRes2.name,
|
||||
message: pushRes2.message,
|
||||
stack: pushRes2.stack,
|
||||
cause: pushRes2.cause,
|
||||
}
|
||||
: pushRes2),
|
||||
};
|
||||
logger.error("Failed to push changes", {
|
||||
...errorFields,
|
||||
gitStatus: JSON.stringify(gitStatus, null, 2),
|
||||
});
|
||||
throw new Error("Failed to push changes");
|
||||
} else {
|
||||
logger.info("Pulling changes before pushing succeeded");
|
||||
}
|
||||
} else {
|
||||
logger.info("Successfully pushed changes");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue