diff options
author | Guyzmo <guyzmo+github@m0g.net> | 2016-06-08 19:45:35 +0200 |
---|---|---|
committer | Guyzmo <guyzmo+github@m0g.net> | 2016-06-08 19:47:43 +0200 |
commit | 3f4b410c955ea08bfb7842320afa568090242679 (patch) | |
tree | 95bb2a60d180be482a4a12a06b2765d274c2be48 | |
parent | b366d3fabd79e921e30b44448cb357a05730c42f (diff) | |
download | gitpython-3f4b410c955ea08bfb7842320afa568090242679.tar.gz |
Switching the `urls` property to use `git remote show` instead of `git remote get-url`
`get-url` is a new API that is not widely available yet (introduced in git 2.7.0), and
provokes failure on travis.
Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
-rw-r--r-- | git/remote.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/remote.py b/git/remote.py index ef02c629..5e9fe2c0 100644 --- a/git/remote.py +++ b/git/remote.py @@ -477,10 +477,10 @@ class Remote(LazyMixin, Iterable): def urls(self): """:return: Iterator yielding all configured URL targets on a remote as strings""" - scmd = 'get-url' - kwargs = {'insert_kwargs_after': scmd} - for url in self.repo.git.remote(scmd, self.name, all=True, **kwargs).split('\n'): - yield url + remote_details = self.repo.git.remote("show", self.name) + for line in remote_details.split('\n'): + if ' Push URL:' in line: + yield line.split(': ')[-1] @property def refs(self): |