pygit2
pygit2 copied to clipboard
Cannot delete a remote with multiple fetch refspecs
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.