feat: fetch refspec so all remote branches become proper tracking branches

This commit is contained in:
Alpha Nerd 2026-05-12 09:09:46 +02:00
parent d5ddab0cbd
commit d02dcadc0d
Signed by: alpha-nerd
SSH key fingerprint: SHA256:QkkAgVoYi9TQ0UKPkiKSfnerZy2h4qhi3SVPXJmBN+M

View file

@ -690,11 +690,9 @@ async function checkoutLocalBranch(pr: ForgejoPullRequest) {
const branch = pr.head.ref
const { forgejoToken } = getForgejoConfig()
await authedGit(forgejoToken, [
"fetch", "origin", "--depth=100",
`+refs/heads/${branch}:refs/remotes/origin/${branch}`,
])
await $`git checkout -B ${branch} --track origin/${branch}`
await $`git config --replace-all remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"`
await authedGit(forgejoToken, ["fetch", "origin", "--depth=100", branch])
await $`git checkout -B ${branch} origin/${branch}`
}
async function checkoutForkBranch(pr: ForgejoPullRequest) {