fix: detached head check
This commit is contained in:
parent
a50df466d0
commit
da1292a45f
1 changed files with 2 additions and 0 deletions
|
|
@ -30,6 +30,8 @@ class GitService:
|
||||||
self._repo.git.checkout(sha)
|
self._repo.git.checkout(sha)
|
||||||
|
|
||||||
def get_head(self) -> Head:
|
def get_head(self) -> Head:
|
||||||
|
if self._repo.head.is_detached:
|
||||||
|
return Head(self._repo.head.object.hexsha, "detached")
|
||||||
return Head(
|
return Head(
|
||||||
self._repo.active_branch.commit.hexsha,
|
self._repo.active_branch.commit.hexsha,
|
||||||
self._repo.active_branch.name
|
self._repo.active_branch.name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue