If too many files staged library throws exception

#2 · closed · 2 comments

View on GitHub ↗

Aetet

If using ``` javascript sgf(filter, callback) ``` on too many staged files library throws stdout exceeded exception. That relates with [child_process.exec](https://github.com/mcwhittemore/staged-git-files/blob/master/index.js#L58) usage which kills application if buffer overflow. It should use [child_process.spawn](http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) instead because it hasn't issue with buffer limit.

Comments

mcwhittemore

@Aetet how many files are you talking about? I have a test thats adding 1000 files with no problem?

mcwhittemore

I've published [0.0.4](https://www.npmjs.com/package/staged-git-files) to npm. Still wasn't able to prove the buffer problem, but moving to spawn is something I wanted to do anyway. I tested it up to 5000 with no problems.