Skip to content

Commit b2b8aac

Browse files
authored
fix: handle dangling branch in .git/HEAD (WangYihang#26)
1 parent 766ccaf commit b2b8aac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GitHacker/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def parse_current_branch_name(self):
281281
# [1] https://stackoverflow.com/a/67151923
282282
# [2] https://github.com/git/git/blob/v2.37.1/refs.c#L38-L57
283283
branch_names = re.findall(r'ref: refs/heads/([a-zA-Z\d_-]+)', response.text)
284-
assert len(branch_names) == 1
284+
assert len(branch_names) <= 1
285285
return branch_names
286286

287287
def parse_logged_branch_names(self):

0 commit comments

Comments
 (0)