mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Change cmd_output_bs retcode arg to a boolean check
This commit is contained in:
parent
71925c47ea
commit
84b38f7b89
15 changed files with 28 additions and 26 deletions
|
|
@ -263,7 +263,7 @@ def _all_filenames(args: argparse.Namespace) -> Collection[str]:
|
|||
|
||||
def _get_diff() -> bytes:
|
||||
_, out, _ = cmd_output_b(
|
||||
'git', 'diff', '--no-ext-diff', '--ignore-submodules', retcode=None,
|
||||
'git', 'diff', '--no-ext-diff', '--ignore-submodules', check=False,
|
||||
)
|
||||
return out
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ def _has_unmerged_paths() -> bool:
|
|||
def _has_unstaged_config(config_file: str) -> bool:
|
||||
retcode, _, _ = cmd_output_b(
|
||||
'git', 'diff', '--no-ext-diff', '--exit-code', config_file,
|
||||
retcode=None,
|
||||
check=False,
|
||||
)
|
||||
# be explicit, other git errors don't mean it has an unstaged config.
|
||||
return retcode == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue