From a3fb57aee3f26571aac4595c6a299c60c98d2143 Mon Sep 17 00:00:00 2001 From: dw-0 Date: Sun, 10 Nov 2024 19:54:26 +0100 Subject: [PATCH] refactor: return `-` if branch cannot be read Signed-off-by: Dominik Willner --- kiauh/utils/git_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kiauh/utils/git_utils.py b/kiauh/utils/git_utils.py index ee7073e..1ffdd4b 100644 --- a/kiauh/utils/git_utils.py +++ b/kiauh/utils/git_utils.py @@ -104,10 +104,10 @@ def get_current_branch(repo: Path) -> str: result: str = check_output(cmd, stderr=DEVNULL, cwd=repo).decode( encoding="utf-8" ) - return result.strip() + return result.strip() if result else "-" except CalledProcessError: - return "" + return "-" def get_local_tags(repo_path: Path, _filter: str | None = None) -> List[str]: