refactor: return - if branch cannot be read
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
1 parent
8aee23830a
commit
a3fb57aee3
1 file changed
+2
-2
@@ -104,10 +104,10 @@ def get_current_branch(repo: Path) -> str:
|
|||||||
result: str = check_output(cmd, stderr=DEVNULL, cwd=repo).decode(
|
result: str = check_output(cmd, stderr=DEVNULL, cwd=repo).decode(
|
||||||
encoding="utf-8"
|
encoding="utf-8"
|
||||||
)
|
)
|
||||||
return result.strip()
|
return result.strip() if result else "-"
|
||||||
|
|
||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
return ""
|
return "-"
|
||||||
|
|
||||||
|
|
||||||
def get_local_tags(repo_path: Path, _filter: str | None = None) -> List[str]:
|
def get_local_tags(repo_path: Path, _filter: str | None = None) -> List[str]:
|
||||||
|
|||||||
Reference in new issue
Block a user