Skip to content

fix: Branch reset causes initial Github API commit to be lost #5486

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

Merged
merged 5 commits into from
Jun 25, 2025

Conversation

MattiasAng
Copy link
Contributor

@MattiasAng MattiasAng commented Jun 25, 2025

Fix #5463

Introduces a new variable to track if the locally checked out branch was reset from based branch. This is then utilised to make sure that the reset is pushed to remote before Github API commit is done as in its current behaviour it would be force pushed away when subsequent push it done due to remote pull failing due to a no fast-forward error.

Test

Follow steps to reproduce in corresponding issue once from latest release and then from this pull request.
In the latest release the initial commit got forced pushed away due to branch reset, while with the changes in this pull request the branch reset is pushed before any commit is done.

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

Change Gogit struct to receive a pointer to allow tracking of this variable.
@MattiasAng MattiasAng force-pushed the gh-api-diverge-fix branch from eb2a958 to 7ee3c6c Compare June 25, 2025 14:58
@MattiasAng MattiasAng force-pushed the gh-api-diverge-fix branch from 7ee3c6c to ce57393 Compare June 25, 2025 15:04
@olblak olblak added github_actions Pull requests that update Github_actions code scm-github SCM of type GiHhub bug Something isn't working labels Jun 25, 2025
@olblak olblak enabled auto-merge (squash) June 25, 2025 15:50
@olblak olblak merged commit 38d4487 into updatecli:main Jun 25, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working github_actions Pull requests that update Github_actions code scm-github SCM of type GiHhub
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github API - Diverging branch causes initial commit to be lost if branch already exists
2 participants