From e648efdcc1ca904709a646c1dbc797454a307444 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 3 Nov 2009 19:49:38 +0100 Subject: remotes are now retrieved directly by parsing the repository configuration file. This removes a git command invocation --- lib/git/remote.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/git/remote.py b/lib/git/remote.py index 5019daee..1b054253 100644 --- a/lib/git/remote.py +++ b/lib/git/remote.py @@ -444,10 +444,16 @@ class Remote(LazyMixin, Iterable): Returns Iterator yielding Remote objects of the given repository """ - seen_remotes = set() - for name in repo.git.remote().splitlines(): - yield Remote(repo, name) - # END for each ref + for section in repo.config_reader("repository").sections(): + print section + if not section.startswith('remote'): + continue + lbound = section.find('"') + rbound = section.rfind('"') + if lbound == -1 or rbound == -1: + raise ValueError("Remote-Section has invalid format: %r" % section) + yield Remote(repo, section[lbound+1:rbound]) + # END for each configuration section @property def refs(self): -- cgit v1.2.3