abhinav / git-spice

Manage stacked Git branches
https://abhinav.github.io/git-spice/
GNU General Public License v3.0
220 stars 11 forks source link

branch create: Don't create or commit if store would reject #423

Closed abhinav closed 3 weeks ago

abhinav commented 3 weeks ago

By using the new BranchTx API, we're able to check whether the store will accept the change before we actually create the branch.

So, we now first prepare the transaction with the new branch state, and only if that succeeds do we actually create the branch.

This way, if the store would reject the change because the base branch is untracked or something similar, we'll roll back to the original target branch and staged changes.

abhinav commented 3 weeks ago

This change is part of the following stack:

Change managed by git-spice.