diff options
author | Yaroslav Halchenko <debian@onerussian.com> | 2016-09-23 13:44:22 -0400 |
---|---|---|
committer | Yaroslav Halchenko <debian@onerussian.com> | 2016-09-23 13:44:48 -0400 |
commit | 41fd2c679310e3f7972bd0b60c453d8b622f4aea (patch) | |
tree | 8787319def21918eeb75e7283087aa6ec791f513 | |
parent | 48c149c16a9bb06591c2eb0be4cca729b7feac3e (diff) | |
download | gitpython-41fd2c679310e3f7972bd0b60c453d8b622f4aea.tar.gz |
BF: allow for other section names which start with a string "remote"
by demanding a space after a word remote, and space is explicitly described as
a delimiter in man git-config:
To begin a subsection put its name in double quotes, separated by space from the section name,
otherwise e.g.
File "/usr/lib/python2.7/dist-packages/datalad/support/gitrepo.py", line 836, in get_remote_branches
for remote in self.repo.remotes:
File "/home/yoh/deb/gits/python-git/git/repo/base.py", line 271, in remotes
return Remote.list_items(self)
File "/home/yoh/deb/gits/python-git/git/util.py", line 745, in list_items
out_list.extend(cls.iter_items(repo, *args, **kwargs))
File "/home/yoh/deb/gits/python-git/git/remote.py", line 453, in iter_items
raise ValueError("Remote-Section has invalid format: %r" % section)
ValueError: Remote-Section has invalid format: u'remotes'
-rw-r--r-- | git/remote.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git/remote.py b/git/remote.py index 12129460..4a8a5ee9 100644 --- a/git/remote.py +++ b/git/remote.py @@ -445,7 +445,7 @@ class Remote(LazyMixin, Iterable): def iter_items(cls, repo): """:return: Iterator yielding Remote objects of the given repository""" for section in repo.config_reader("repository").sections(): - if not section.startswith('remote'): + if not section.startswith('remote '): continue lbound = section.find('"') rbound = section.rfind('"') |