Skip to content

Fix sync-from-upstream overwriting existing update branch#147

Merged
fhielpos merged 1 commit intomainfrom
non-override-upstream-sync
Apr 7, 2026
Merged

Fix sync-from-upstream overwriting existing update branch#147
fhielpos merged 1 commit intomainfrom
non-override-upstream-sync

Conversation

@fhielpos
Copy link
Copy Markdown
Member

@fhielpos fhielpos commented Apr 7, 2026

Use the existing remote branch when it already exists instead of
resetting from main with -B and force-pushing. This preserves any
commits already on the update branch.

- Check for remote branch existence with git ls-remote before checkout
- Track the existing remote branch if present, otherwise create from main
- Guard commit with git diff --cached to skip if vendir.yml unchanged
- Drop --force from git push
@fhielpos fhielpos self-assigned this Apr 7, 2026
@fhielpos fhielpos requested a review from a team April 7, 2026 16:42
@fhielpos fhielpos requested a review from a team as a code owner April 7, 2026 16:42
@fhielpos fhielpos merged commit ddc57f4 into main Apr 7, 2026
1 check passed
@fhielpos fhielpos deleted the non-override-upstream-sync branch April 7, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant