Skip to content

Add API for unsetting multivar entry #1719

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

Closed
kzu opened this issue Sep 26, 2019 · 0 comments · Fixed by #1720
Closed

Add API for unsetting multivar entry #1719

kzu opened this issue Sep 26, 2019 · 0 comments · Fixed by #1720

Comments

@kzu
Copy link
Contributor

kzu commented Sep 26, 2019

Reproduction steps

Given a multivar setting (i.e. "plugin"):

// throws LibGit2Sharp.LibGit2SharpException: 'entry is not unique due to being a multivar'
repo.Config.Unset("plugin");

Expected behavior

Provide an UnsetAll(key, level) pair of overloads that basically expose the existing UnsetMultivar behavior.

Actual behavior

Exception thrown: LibGit2Sharp.LibGit2SharpException: 'entry is not unique due to being a multivar'

Version of LibGit2Sharp (release number or SHA1)

0.26.1

Operating system(s) tested; .NET runtime tested

.NET Core 2.1

kzu added a commit to kzu/libgit2sharp that referenced this issue Sep 27, 2019
Implement value adding by exposing the underlying `set_multivar`,
which supports only string values in the underlying libgit2, so no
other typed overloads are provided at this point.

The counterpart for deleting keys exposes the underlying `delete_multivar`.
No regex-based overload is exposed for consistency with the existing `Set<T>`
overloads which don't expose it either.

Also exposed the boolean return value from the `Unset` calls which
is already present in the Proxy API.

Fixes libgit2#1719.
kzu added a commit to kzu/libgit2sharp that referenced this issue Sep 27, 2019
Implement value adding by exposing the underlying `set_multivar`,
which supports only string values in the underlying libgit2, so no
other typed overloads are provided at this point.

The counterpart for deleting keys exposes the underlying `delete_multivar`.
No regex-based overload is exposed for consistency with the existing `Set<T>`
overloads which don't expose it either.

Also exposed the boolean return value from the `Unset` calls which
is already present in the Proxy API.

Fixes libgit2#1719.
kzu added a commit to kzu/libgit2sharp that referenced this issue Sep 28, 2019
Implement value adding by exposing the underlying `set_multivar`,
which supports only string values in the underlying libgit2, so no
other typed overloads are provided at this point.

The counterpart for deleting keys exposes the underlying `delete_multivar`.
No regex-based overload is exposed for consistency with the existing `Set<T>`
overloads which don't expose it either.

Also exposed the boolean return value from the `Unset` calls which
is already present in the Proxy API.

Fixes libgit2#1719.

Fix
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 a pull request may close this issue.

1 participant