git-branchless icon indicating copy to clipboard operation
git-branchless copied to clipboard

Fail to delete a branch while syncing if config entries contain multivars (tracking issue)

Open samueltardieu opened this issue 5 months ago • 0 comments

Description of the bug

If a branch config contains duplicate variables (multivar), it may make git branchless sync exit with an error while attempting to remove the branch.

$ git sync --pull
[…]
The application panicked (crashed).
Message:  A fatal error occurred:
   0: could not delete branch: entry is not unique due to being a multivar; class=Config (7)
   1: entry is not unique due to being a multivar; class=Config (7)
[…]

The error happens when attempting to remove a branch whose config looks like this:

[branch."sam/foobar"]
gitpublishto = [email protected]
gitpublishto = [email protected]

The core issue is located upstream²: https://github.com/libgit2/libgit2/issues/6722

Tracking

  • [ ] Issue is solved in libgit2
  • [ ] libgit2 has been released with the fix
  • [ ] Issue is solved in git2-rs
  • [ ] git2-rs has been released with the fix

Expected behavior

This should properly remove the branch which has been merged.

Actual behavior

git branchless sync panics.

Version of rustc

No response

Automated bug report

No response

Version of git-branchless

git-branchless-opts 0.8.0

Version of git

git version 2.43.0

samueltardieu avatar Jan 22 '24 22:01 samueltardieu