Skip to content

Incorrect behavior of Repo.remote() #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ereOn opened this issue Jan 7, 2015 · 0 comments
Closed

Incorrect behavior of Repo.remote() #229

ereOn opened this issue Jan 7, 2015 · 0 comments
Assignees

Comments

@ereOn
Copy link

ereOn commented Jan 7, 2015

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.

@Byron Byron added this to the v0.3.5 - bugfixes milestone Jan 7, 2015
@Byron Byron self-assigned this Jan 8, 2015
@Byron Byron closed this as completed in f7b7eb6 Jan 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants