diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 09:45:50 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 09:45:50 +0100 |
commit | f7b7eb6245e7d7c4535975268a9be936e2c59dc8 (patch) | |
tree | bdc6c5aa710632cc60e2c31ab08882c1e8b0d958 /git/repo/base.py | |
parent | c7887c66483ffa9a839ecf1a53c5ef718dcd1d2d (diff) | |
download | gitpython-f7b7eb6245e7d7c4535975268a9be936e2c59dc8.tar.gz |
Added Remote.exists() method, and test. Fixes #229
Diffstat (limited to 'git/repo/base.py')
-rw-r--r-- | git/repo/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index 34fe4046..7bd2be48 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -250,7 +250,10 @@ class Repo(object): 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) + r = Remote(self, name) + if not r.exists(): + raise ValueError("Remote named '%s' didn't exist" % name) + return r #{ Submodules |