This repository was archived by the owner on Nov 9, 2017. It is now read-only.
File tree 1 file changed +42
-0
lines changed 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,48 @@ sub run_cmd_pipe {
177
177
die " $^O does not support: @invalid \n" if @invalid ;
178
178
my @args = map { m/ /o ? " \" $_ \" " : $_ } @_ ;
179
179
return qx{ @args } ;
180
+ } elsif (($^O eq ' MSWin32' || $^O eq ' msys' ) && (scalar @_ > 200)) {
181
+
182
+ # workaround for https://github.com/msysgit/git/issues/182
183
+ # mostly the work of @PhilipDavis, circa 2014-08-07
184
+
185
+ my @myArgs = @_ ;
186
+ my $cmd = " @myArgs " ;
187
+ my $path = " $ENV {APPDATA}" ;
188
+ $path =~ s /\\ / \/ / g ;
189
+
190
+ use File::Temp qw( tempfile) ;
191
+ # for troubleshooting, you might find it useful to eliminate the UNLINK setting:
192
+ my ($fhargs , $filename ) = tempfile(" $path /git-args-XXXXXX" , UNLINK => 1);
193
+
194
+ if (grep $_ eq " --" , @myArgs ) {
195
+
196
+ $cmd = " " ;
197
+ while ($myArgs [0] ne ' --' ) {
198
+ $cmd = $cmd . shift (@myArgs ) . " " ;
199
+ }
200
+
201
+ $cmd = $cmd . " -- " ;
202
+ shift (@myArgs );
203
+
204
+ foreach (@myArgs ) {
205
+ # if files have whitespace in the name, quotes around $_ are mandatory:
206
+ print $fhargs " \" $_ \" \n " ;
207
+ }
208
+
209
+ $fhargs -> flush;
210
+
211
+ # 2015 may 26: @kkheller using cat to xargs instead of "< $filename"
212
+ $cmd = " cat $filename | xargs -s 20000 " . $cmd ;
213
+ }
214
+
215
+ print " $filename \n " ;
216
+ print " $cmd \n\n " ;
217
+
218
+ my $fh = undef ;
219
+ open ($fh , ' -|' , $cmd ) or die ;
220
+ return <$fh >;
221
+
180
222
} else {
181
223
my $fh = undef ;
182
224
open ($fh , ' -|' , @_ ) or die ;
You can’t perform that action at this time.
0 commit comments