According to its documentation, Repo.remote() is supposed to raise a ValueError is the specified remote name does not match an existing remote on the repository.
However, from the code it seems that its not the case:
def remote(self, name='origin'):
""":return: Remote with the specified name
:raise ValueError: if no remote with such a name exists"""
return Remote(self, name)
See the __init__ implementation for Remote:
class Remote(LazyMixin, Iterable):
def __init__(self, repo, name):
self.repo = repo
self.name = name
if os.name == 'nt':
dir(self)
The actual code just create a Remote instance which fails later on whenever one of its method is called.
This is likely not the expected behavior and I would assume the documation to be more sensible that the current implementation.
According to its documentation,
Repo.remote()is supposed to raise aValueErroris the specified remote name does not match an existing remote on the repository.However, from the code it seems that its not the case:
See the
__init__implementation forRemote:The actual code just create a
Remoteinstance which fails later on whenever one of its method is called.This is likely not the expected behavior and I would assume the documation to be more sensible that the current implementation.