Skip to content

Fix for #142. Simply ignores lines that begin with ' =' #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2014

Conversation

nefaspartim
Copy link

This is kind of a hacky fix for #142. It works in all test cases using git 1.8.3.1 and 1.9.2, so I assume it won't break stuff. Please examine and subsequently make fun of me.

@Byron
Copy link
Member

Byron commented May 16, 2014

Well, let's try that - I am suffering from that issues as well by the way and grow more annoyed by it every day.
Thanks for your contribution !

Byron added a commit that referenced this pull request May 16, 2014
Fix for #142. Simply ignores lines that begin with ' ='
@Byron Byron merged commit f9b915b into gitpython-developers:0.3 May 16, 2014
@rkyser
Copy link

rkyser commented May 28, 2014

This breaks fetching individual remotes. I'm using git version 1.9.2.msysgit.0.

>>> from git import Repo
>>> r = Repo('.')
>>> r.remotes['origin'].fetch()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\gitpython-0.3.2.rc1-py2.7.egg\git\remote.py", line 594, in fetch
    return self._get_fetch_info_from_stderr(proc, progress or RemoteProgress())
  File "C:\Python27\lib\site-packages\gitpython-0.3.2.rc1-py2.7.egg\git\remote.py", line 540, in _get_fetch_info_from_stderr
    assert len(fetch_info_lines) == len(fetch_head_info), "len(%s) != len(%s)" % (fetch_head_info, fetch_info_lines)
AssertionError: len(["26a25a032bc442de391425e89be07124ea2ba845\t\tbranch 'master' of fake.url.com:gint/testrepo1\n", "59d3007c47269d7bb2b3c464a6ed290ec9a95a6f\tnot-for-merge\tbranch 'RemoteOnlyBranch_DontCheckout' of fake.url.com:gint/testrepo1\n", "43ce9f5dd15f817eb806331648ed70e82e3b8b06\tnot-for-merge\tbranch 'branch1' of fake.url.com:gint/testrepo1\n"]) != len([])

If I remove or line.startswith(' ='):

>>> from git import Repo
>>> r = Repo('.')
>>> r.remotes['origin'].fetch()
[<git.remote.FetchInfo object at 0x02550DA0>, <git.remote.FetchInfo object at 0x02550F30>, <git.remote.FetchInfo object at 0x02550E90>]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants