summaryrefslogtreecommitdiffstats
path: root/pre_commit/xargs.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-10 14:27:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-19 13:32:50 +0000
commit35f0c72f09eaa652cb468ed1b4ad7c707ed83c5e (patch)
treec0257364c514cb1c845d82e34a6e5dd9b1fc28c3 /pre_commit/xargs.py
parentReleasing debian version 2.11.1-1. (diff)
downloadpre-commit-35f0c72f09eaa652cb468ed1b4ad7c707ed83c5e.tar.xz
pre-commit-35f0c72f09eaa652cb468ed1b4ad7c707ed83c5e.zip
Merging upstream version 2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/xargs.py')
-rw-r--r--pre_commit/xargs.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pre_commit/xargs.py b/pre_commit/xargs.py
index 60a057c..6b0fa20 100644
--- a/pre_commit/xargs.py
+++ b/pre_commit/xargs.py
@@ -145,7 +145,9 @@ def xargs(
# this is implementation details but the command gets translated into
# full/path/to/cmd.exe /c *cmd
cmd_exe = parse_shebang.find_executable('cmd.exe')
- _max_length = 8192 - len(cmd_exe) - len(' /c ')
+ # 1024 is additionally subtracted to give headroom for further
+ # expansion inside the batch file
+ _max_length = 8192 - len(cmd_exe) - len(' /c ') - 1024
partitions = partition(cmd, varargs, target_concurrency, _max_length)