Fix Auto Remote Fetching from Nomi-CEu/Nomi-CEu (#889)

[SKIP]
This commit is contained in:
Integer Limit 2024-08-11 20:43:31 +10:00 committed by GitHub
parent 1bca3ffd3b
commit c39542f51e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,10 +116,13 @@ export default class PortQBData {
throw new Error("Branch already Exists!");
}
// Fetch
await git.fetch(remote);
// Create the Ref Branch, tracking the remote's main branch, but do not switch to it
const currBranch = (await git.raw(["branch", "--show-current"])).trim();
await git.stash();
await git.checkoutBranch(this.ref, `${remote}/main`);
await git.checkoutBranch(this.ref, `remotes/${remote}/main`);
await git.checkout(currBranch);
// Pop the newest stash (the one we just created)