FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Referencing FETCH_HEAD's commit incorrectly raises ValueError · Issue #130 · gitpython-developers/GitPython · GitHub

Repository navigation

Referencing FETCH_HEAD's commit incorrectly raises ValueError #130

Closed

Description

To reproduce on tag 0.3:

origin = repo.remotes.origin
fetch_info = origin.fetch('master')  # The most recent origin/master is now on FETCH_HEAD
foo = fetch_info.FETCH_HEAD.commit
>> ValueError: Failed to parse reference information from 'FETCH_HEAD'

.git/FETCH_HEAD

60b64ef992065e2600bfef6187a97f92398a9144                branch 'master' of git-server:/path/to/repo

Output of tokens from git.refs.symbolic:130

['60b64ef992065e2600bfef6187a97f92398a9144\t\tbranch', "'master'", 'of', 'git.sympoz.net:/data2/git/sympoz-beta']

I patched in my local project ( but have not run tests or prepared a proper PR )

-                      tokens = value.split(" ")
+                      tokens = value.split()      

Activity

  1. chroto commented on Dec 16, 2013

    Author
    • git version 1.7.12.4 (Apple Git-37)
    • Python 2.6.7
  2. added a commit that references this issue on Dec 16, 2013
  3. klimkin commented on Jan 7, 2014

    This also helps to fix this problem:

    >>> r.commit('FETCH_HEAD')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/nfs/pdx/home/adklimki/.local/lib/python2.7/site-packages/GitPython-0.3.2.RC1-py2.7.egg/git/repo/base.py", line 378, in commit
        return self.rev_parse(str(rev)+"^0")
      File "/nfs/pdx/home/adklimki/.local/lib/python2.7/site-packages/GitPython-0.3.2.RC1-py2.7.egg/git/repo/fun.py", line 151, in rev_parse
        obj = name_to_object(repo, rev[:start])
      File "/nfs/pdx/home/adklimki/.local/lib/python2.7/site-packages/GitPython-0.3.2.RC1-py2.7.egg/git/repo/fun.py", line 86, in name_to_object
        raise BadObject(name)
    gitdb.exc.BadObject: BadObject: 46455443485f48454144
    
  4. added this to the v0.3.3 milestone on Nov 19, 2014
  5. Byron commented on Nov 19, 2014

    Member

    Thanks - I have implemented the fix you referred to, and verified it doesn't break anything.

  6. added a commit that references this issue on Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL