diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-03 19:49:38 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-03 19:49:38 +0100 |
commit | e648efdcc1ca904709a646c1dbc797454a307444 (patch) | |
tree | 1643094b3367c6c087e5e5ee2cb402c8318ce1e9 /lib/git/remote.py | |
parent | 9b426893ce331f71165c82b1a86252cd104ae3db (diff) | |
download | gitpython-e648efdcc1ca904709a646c1dbc797454a307444.tar.gz |
remotes are now retrieved directly by parsing the repository configuration file. This removes a git command invocation
Diffstat (limited to 'lib/git/remote.py')
-rw-r--r-- | lib/git/remote.py | 14 |
1 files changed, 10 insertions, 4 deletions
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): |