mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-06 17:02: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 },
|
{ 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");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue