pygit2
pygit2 copied to clipboard
`pygit2.remote.RemoteCollection` should implement `__contains__()` to match with valid remote names
As it stands the following happens
>>> import os, pygit2
>>> r = pygit2.Repository(os.getcwd())
>>> 'origin' in r.remotes
False
Whereas looping over the names results in a match
>>> import os, pygit2
>>> r = pygit2.Repository(os.getcwd())
>>> 'origin' in [remote.name for remote in r.remotes]
True
This behavior seems unpythonic since remote.RemoteCollection implements __getitem__() and in doesn't match with a valid key in the collection.
If this change makes sense I can to try fix it when I have time, lmk!