You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use hexsha instead of active_branch to work around detached head
When concourse checks out a repo it leaves it in a detached head
state. This was causing errors as python git has slightly undefined
behaviour in this case.
```
File "detect_checker.py", line 125, in _load_repo
self.parent_branch = self.repo.active_branch
File "/home/a/venv/local/lib/python3.7/site-packages/git/repo/base.py", line 703, in active_branch
return self.head.reference
File "/home/a/venv/local/lib/python3.7/site-packages/git/refs/symbolic.py", line 272, 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 '6e589de2864ee310a46a343ae9d656405e6b8c84'
```
gitpython-developers/GitPython#633
This PR changes it use the hexsha instead which works correctly with
detached heads and normal branches.
Co-authored-by: detnon <[email protected]>
Co-authored-by: Alex Kinnane <[email protected]>
0 commit comments