From d02dcadc0d1581028bb1a8275e4273c701f1fcdd Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Tue, 12 May 2026 09:09:46 +0200 Subject: [PATCH] feat: fetch refspec so all remote branches become proper tracking branches --- index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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) {