Revert "Change cmd_output_bs retcode arg to a boolean check"

This commit is contained in:
Martin Gustafsson 2022-10-30 23:29:13 +01:00 committed by GitHub
parent 0827de1864
commit 19710cd956
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 37 additions and 33 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, check=False)[0] == 1
return cmd_output_b(*cmd, cwd=repo, retcode=None)[0] == 1
def has_core_hookpaths_set() -> bool:
_, out, _ = cmd_output_b('git', 'config', 'core.hooksPath', check=False)
_, out, _ = cmd_output_b('git', 'config', 'core.hooksPath', retcode=None)
return bool(out.strip())