mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-03 01:03:26 +00:00
chore: Set upstream branch when cloning repo (#522)
This commit is contained in:
parent
3bae3f7bd7
commit
aec3a8fc1b
2 changed files with 25 additions and 1 deletions
|
|
@ -251,6 +251,18 @@ async function performClone(
|
||||||
logger.info("Created branch", {
|
logger.info("Created branch", {
|
||||||
branch: branchName,
|
branch: branchName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const setUpstreamBranchRes = await sandbox.process.executeCommand(
|
||||||
|
`git branch --set-upstream-to=origin/${branchName}`,
|
||||||
|
absoluteRepoDir,
|
||||||
|
);
|
||||||
|
if (setUpstreamBranchRes.exitCode !== 0) {
|
||||||
|
logger.error("Failed to set upstream branch", {
|
||||||
|
setUpstreamBranchRes,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
logger.info("Set upstream branch");
|
||||||
|
|
||||||
return branchName;
|
return branchName;
|
||||||
} catch {
|
} catch {
|
||||||
logger.info("Failed to create branch, checking out branch", {
|
logger.info("Failed to create branch, checking out branch", {
|
||||||
|
|
@ -262,5 +274,17 @@ async function performClone(
|
||||||
logger.info("Checked out branch", {
|
logger.info("Checked out branch", {
|
||||||
branch: branchName,
|
branch: branchName,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const setUpstreamBranchRes = await sandbox.process.executeCommand(
|
||||||
|
`git branch --set-upstream-to=origin/${branchName}`,
|
||||||
|
absoluteRepoDir,
|
||||||
|
);
|
||||||
|
if (setUpstreamBranchRes.exitCode !== 0) {
|
||||||
|
logger.error("Failed to set upstream branch", {
|
||||||
|
setUpstreamBranchRes,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
logger.info("Set upstream branch");
|
||||||
|
|
||||||
return branchName;
|
return branchName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ export const ALLOWED_USERS = [
|
||||||
"xornivore",
|
"xornivore",
|
||||||
"xuro-langchain",
|
"xuro-langchain",
|
||||||
"Palashio",
|
"Palashio",
|
||||||
"ads2280"
|
"ads2280",
|
||||||
];
|
];
|
||||||
|
|
||||||
// HACK: Until we setup proper support for API credits, we will only allow users to self host Open SWE
|
// HACK: Until we setup proper support for API credits, we will only allow users to self host Open SWE
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue