feat: fetch refspec so all remote branches become proper tracking branches
This commit is contained in:
parent
d5ddab0cbd
commit
d02dcadc0d
1 changed files with 3 additions and 5 deletions
8
index.ts
8
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue