From a596e1284c8a13784fd51b2832815fc2515b8d6a Mon Sep 17 00:00:00 2001 From: Guyzmo Date: Tue, 11 Oct 2016 14:25:23 +0200 Subject: remote, #528: Improved way of listing URLs + Instead of using `git remote show` that may triggers connection to remote repo, use `git remote get-url --all` that works by only reading the `.git/config`. + Change should have no functional impact, so no test needed. + Works only with git -2.7+. Signed-off-by: Guyzmo --- git/remote.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index 5d31a442..c28f7efb 100644 --- a/git/remote.py +++ b/git/remote.py @@ -496,10 +496,9 @@ class Remote(LazyMixin, Iterable): def urls(self): """:return: Iterator yielding all configured URL targets on a remote as strings""" - remote_details = self.repo.git.remote("show", self.name) + remote_details = self.repo.git.remote("get-url", "--all", self.name) for line in remote_details.split('\n'): - if ' Push URL:' in line: - yield line.split(': ')[-1] + yield line @property def refs(self): -- cgit v1.2.1