Cannot delete a remote with multiple fetch refspecs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
Steps to reproduce:
>>> import pygit2
>>> repo = pygit2.init_repository(".")
>>> repo.remotes.create("origin", "https://github.com/libgit2/pygit2.git")
>>> repo.remotes.add_fetch("origin", "refs/heads/master:refs/remotes/origin/master")
>>> repo.remotes.add_fetch("origin", "refs/tags/*:refs/tags/*")
>>> repo.remotes.delete("origin")
_pygit2.GitError, entry is not unique due to being a multivar
This is present in the latest release and I also saw it happen (though with different error text) in 0.27
There doesn't appear to be a viable workaround because the libgit2 function for deleting multivars in the config isn't exposed in pygit2. Otherwise I would have tried to remove the multiple fetch entries directly ahead of time and then delete the remote.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided pygit2 snippet and inspect the remote deletion and configuration handling exposed by pygit2. The fix is complete when deleting a remote with multiple fetch refspecs succeeds without the multivar error, with a regression test covering the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100