Skip to content

How to instruct GitPython to reload gitdb or could it reload automagically? #392

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

Closed
yarikoptic opened this issue Feb 29, 2016 · 1 comment

Comments

@yarikoptic
Copy link
Contributor

If e.g. some native git command has performed gc or repacking?
or ideally -- could it determine necessity to reload on its own

Otherwise, I am hitting exceptions like

  File "/home/yoh/proj/datalad/datalad/datalad/support/gitrepo.py", line 477, in git_get_merge_base
    bases = self.repo.merge_base(*treeishes)
  File "/usr/lib/python2.7/dist-packages/git/repo/base.py", line 502, in merge_base
    res.append(self.commit(line))
  File "/usr/lib/python2.7/dist-packages/git/repo/base.py", line 427, in commit
    return self.rev_parse(text_type(rev) + "^0")
  File "/usr/lib/python2.7/dist-packages/git/repo/fun.py", line 183, in rev_parse
    obj = name_to_object(repo, rev[:start])
  File "/usr/lib/python2.7/dist-packages/git/repo/fun.py", line 120, in name_to_object
    return Object.new_from_sha(repo, hex_to_bin(hexsha))
  File "/usr/lib/python2.7/dist-packages/git/objects/base.py", line 65, in new_from_sha
    oinfo = repo.odb.info(sha1)
  File "/usr/lib/python2.7/dist-packages/gitdb/db/base.py", line 205, in info
    return self._db_query(sha).info(sha)
  File "/usr/lib/python2.7/dist-packages/gitdb/db/loose.py", line 157, in info
    m = self._map_loose_object(sha)
  File "/usr/lib/python2.7/dist-packages/gitdb/db/loose.py", line 146, in _map_loose_object
    raise BadObject(sha)
BadObject: BadObject: 487fd81ffe964e056edd1eb4855ce6323bb50f9f

using 1.0.1+git137-gc8b8379 atm

@yarikoptic
Copy link
Contributor Author

I guess #61 gives the answers, so will close for now

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

No branches or pull requests

1 participant