We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
add -p
add -i
1 parent cae7dcf commit f4c6593Copy full SHA for f4c6593
git-add--interactive.perl
@@ -160,6 +160,24 @@ sub run_cmd_pipe {
160
die "$^O does not support: @invalid\n" if @invalid;
161
my @args = map { m/ /o ? "\"$_\"": $_ } @_;
162
return qx{@args};
163
+ } elsif (($^O eq 'MSWin32' || $^O eq 'msys') && (scalar @_ > 200) &&
164
+ grep $_ eq '--', @_) {
165
+ use File::Temp qw(tempfile);
166
+ my ($fhargs, $filename) =
167
+ tempfile('git-args-XXXXXX', UNLINK => 1);
168
+
169
+ my $cmd = 'cat '.$filename.' | xargs -0 -s 20000 ';
170
+ while ($_[0] ne '--') {
171
+ $cmd = $cmd . shift(@_) . ' ';
172
+ }
173
174
+ shift(@_);
175
+ print $fhargs join("\0", @_);
176
+ close($fhargs);
177
178
+ my $fh = undef;
179
+ open($fh, '-|', $cmd) or die;
180
+ return <$fh>;
181
} else {
182
my $fh = undef;
183
open($fh, '-|', @_) or die;
0 commit comments