8000 Empty (bare) repository causes error · Issue #55 · gitpython-developers/GitPython · GitHub
[go: up one dir, main page]

Skip to content
Empty (bare) repository causes error #55
Closed
@progval

Description

@progval

Hi,

I cannot instanciate a Repo object with a bare repository:

progval@Andromede:~/repositories$ python
Python 2.7.3rc2 (default, Mar 21 2012, 06:59:11) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import git
>>> git.Repo('testing.git').tree()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/git/repo/base.py", line 399, in tree
    return self.head.commit.tree
  File "/usr/local/lib/python2.7/dist-packages/git/refs/symbolic.py", line 168, in _get_commit
    obj = self._get_object()
  File "/usr/local/lib/python2.7/dist-packages/git/refs/symbolic.py", line 161, in _get_object
    return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
  File "/usr/local/lib/python2.7/dist-packages/git/refs/symbolic.py", line 115, in dereference_recursive
    hexsha, ref_path = cls._get_ref_info(repo, ref_path)
  File "/usr/local/lib/python2.7/dist-packages/git/refs/symbolic.py", line 142, in _get_ref_info
    raise ValueError("Reference at %r does not exist" % ref_path)
ValueError: Reference at 'refs/heads/master' does not exist

Regards,
Valentin Lorentz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0