Closed
Description
If I try to access Repo.active_branch while on a detached head, I get the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/git/repo/base.py", line 670, in active_branch
return self.head.reference
File "/usr/local/lib/python2.7/dist-packages/git/refs/symbolic.py", line 258, in _get_reference
raise TypeError("%s is a detached symbolic reference as it points to %r" % (self, sha))
TypeError: HEAD is a detached symbolic reference as it points to '955877d6c1720961e13bdf17db7dfa567a11f77b'