chore: Set upstream branch when cloning repo (#522)

This commit is contained in:
Brace Sproul 2025-07-24 13:21:43 -07:00 • committed by GitHub
parent 3bae3f7bd7
commit aec3a8fc1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 1 deletions

View file

@ -251,6 +251,18 @@ async function performClone(
logger.info("Created branch", {
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;
} catch {
logger.info("Failed to create branch, checking out branch", {
@ -262,5 +274,17 @@ async function performClone(
logger.info("Checked out branch", {
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;
}

View file

@ -54,7 +54,7 @@ export const ALLOWED_USERS = [
"xornivore",
"xuro-langchain",
"Palashio",
"ads2280"
"ads2280",
];
// HACK: Until we setup proper support for API credits, we will only allow users to self host Open SWE