Skip to content

Commit

Permalink
add refs/heads/ prefix to push commands
Browse files Browse the repository at this point in the history
  • Loading branch information
askvinni committed Dec 2, 2024
1 parent cb476ca commit fa38655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/autodev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ const autoDev = async (): Promise<void> => {
if (!branchExists) {
info(`Branch ${branch} does not exist. Creating branch from ${base}.`)
await exec(`git checkout -b ${branch} ${base}`)
await exec(`git push -u origin ${branch}`)
await exec(`git push -u origin refs/heads/${branch}`)
}
await exec(`git checkout -B ${branch}`)

// only push to defined branch if there are changes
await exec('git fetch')
if (await hasDiff('HEAD', `origin/${branch}`)) {
// ignore any errors
await exec(`git push -f -u origin ${branch}`, undefined, {
await exec(`git push -f -u origin refs/heads/${branch}`, undefined, {
ignoreReturnCode: true
})
}
Expand Down

0 comments on commit fa38655

Please sign in to comment.