Skip to content

Commit

Permalink
Merge pull request #1864 from pre-commit/batch_additional_headroom
Browse files Browse the repository at this point in the history
give xargs batch file execution additional headroom
  • Loading branch information
asottile committed Apr 4, 2021
2 parents e431b2b + fb590d4 commit 008717f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pre_commit/xargs.py
Expand Up @@ -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)

Expand Down

0 comments on commit 008717f

Please sign in to comment.