diff --git a/index.ts b/index.ts index c23006c..7c94d20 100644 --- a/index.ts +++ b/index.ts @@ -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) {