Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add refs/heads/ prefix to push commands #357

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading