From 7ca66294242a127fbf827753ba71bc16387ea66b Mon Sep 17 00:00:00 2001 From: Igor Zinovyev Date: Tue, 6 Aug 2024 17:05:18 +0300 Subject: [PATCH] Increased pre-push hook buffer to avoid truncation. (#38734) * Increased pre-push hook buffer to avoid truncation. * Brought back trim. --- tools/js-tools/git-hooks/pre-push-hook.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/js-tools/git-hooks/pre-push-hook.js b/tools/js-tools/git-hooks/pre-push-hook.js index 71cc239f1f13d..6198a50915a06 100644 --- a/tools/js-tools/git-hooks/pre-push-hook.js +++ b/tools/js-tools/git-hooks/pre-push-hook.js @@ -20,14 +20,11 @@ function checkFilenameCollisions() { const compare = Intl.Collator( 'und', { sensitivity: 'accent' } ).compare; - const files = spawnSync( 'git', [ - '-c', - 'core.quotepath=off', - 'ls-tree', - '-rt', - '--name-only', - 'HEAD', - ] ) + const files = spawnSync( + 'git', + [ '-c', 'core.quotepath=off', 'ls-tree', '-rt', '--name-only', 'HEAD' ], + { maxBuffer: 4096 * 1024 } + ) .stdout.toString() .trim() .split( '\n' )