Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scmrepo/git/backend/gitpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ def is_dirty(self, untracked_files: bool = False) -> bool:
return self.repo.is_dirty(untracked_files=untracked_files)

def active_branch(self):
return self.repo.active_branch.name
try:
return self.repo.active_branch.name
except TypeError as exc:
raise SCMError("No active branch") from exc

def list_branches(self):
return [h.name for h in self.repo.heads]
Expand Down