From 638cb1489a90410c2e1502903c1a806c5ebe8587 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 8 Feb 2023 05:17:14 +0100 Subject: Merging upstream version 3.0.4. Signed-off-by: Daniel Baumann --- pre_commit/commands/run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pre_commit/commands/run.py') diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index e44e703..a7eb4f4 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -272,7 +272,8 @@ def _all_filenames(args: argparse.Namespace) -> Collection[str]: def _get_diff() -> bytes: _, out, _ = cmd_output_b( - 'git', 'diff', '--no-ext-diff', '--ignore-submodules', check=False, + 'git', 'diff', '--no-ext-diff', '--no-textconv', '--ignore-submodules', + check=False, ) return out @@ -326,8 +327,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, - check=False, + 'git', 'diff', '--quiet', '--no-ext-diff', config_file, check=False, ) # be explicit, other git errors don't mean it has an unstaged config. return retcode == 1 -- cgit v1.2.3