Skip to content

Commit 88ba1e4

Browse files
committed
fix: set branch name to HEAD if empty
1 parent 89249ec commit 88ba1e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commit_check/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_branch_name() -> str:
2424
try:
2525
# Git 2.22 and above supports `git branch --show-current`
2626
commands = ['git', 'branch', '--show-current']
27-
branch_name = cmd_output(commands)
27+
branch_name = cmd_output(commands) or "HEAD"
2828
except CalledProcessError:
2929
branch_name = ''
3030
return branch_name.strip()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy