Skip to content

Commit 008717f

Browse files
authored
Merge pull request #1864 from pre-commit/batch_additional_headroom
give xargs batch file execution additional headroom
2 parents e431b2b + fb590d4 commit 008717f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pre_commit/xargs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ def xargs(
145145
# this is implementation details but the command gets translated into
146146
# full/path/to/cmd.exe /c *cmd
147147
cmd_exe = parse_shebang.find_executable('cmd.exe')
148-
_max_length = 8192 - len(cmd_exe) - len(' /c ')
148+
# 1024 is additionally subtracted to give headroom for further
149+
# expansion inside the batch file
150+
_max_length = 8192 - len(cmd_exe) - len(' /c ') - 1024
149151

150152
partitions = partition(cmd, varargs, target_concurrency, _max_length)
151153

0 commit comments

Comments
 (0)