arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git
Apache License 2.0
3.38k stars 80 forks source link

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

Open samueltardieu opened 5 months ago

samueltardieu commented 5 months ago

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 = example1@example.com
gitpublishto = example2@example.com

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

Tracking

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