summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-08 04:17:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-08 04:17:11 +0000
commit9139c894a3d5d30791bf7907cf8546e0bc686048 (patch)
tree3ff3e06ca019571c4ce940af3775a8df7007997a /pre_commit/commands
parentAdding upstream version 3.0.3. (diff)
downloadpre-commit-9139c894a3d5d30791bf7907cf8546e0bc686048.tar.xz
pre-commit-9139c894a3d5d30791bf7907cf8546e0bc686048.zip
Adding upstream version 3.0.4.upstream/3.0.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/commands')
-rw-r--r--pre_commit/commands/run.py6
1 files changed, 3 insertions, 3 deletions
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