Skip to content

Incorrect behavior of Repo.remote() #229

Closed
@ereOn

Description

@ereOn

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions