Change cmd_output_bs retcode arg to a boolean check

This commit is contained in:
marsha
2022-10-30 14:47:42 -05:00
parent 71925c47ea
commit 84b38f7b89
15 changed files with 28 additions and 26 deletions

View File

@@ -187,11 +187,11 @@ def head_rev(remote: str) -> str:
def has_diff(*args: str, repo: str = '.') -> bool:
cmd = ('git', 'diff', '--quiet', '--no-ext-diff', *args)
return cmd_output_b(*cmd, cwd=repo, retcode=None)[0] == 1
return cmd_output_b(*cmd, cwd=repo, check=False)[0] == 1
def has_core_hookpaths_set() -> bool:
_, out, _ = cmd_output_b('git', 'config', 'core.hooksPath', retcode=None)
_, out, _ = cmd_output_b('git', 'config', 'core.hooksPath', check=False)
return bool(out.strip())