We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
add -p
add -i
1 parent 787bfe4 commit 2584706Copy full SHA for 2584706
git-add--interactive.perl
@@ -174,6 +174,24 @@ sub run_cmd_pipe {
174
die "$^O does not support: @invalid\n" if @invalid;
175
my @args = map { m/ /o ? "\"$_\"": $_ } @_;
176
return qx{@args};
177
+ } elsif (($^O eq 'MSWin32' || $^O eq 'msys') && (scalar @_ > 200) &&
178
+ grep $_ eq '--', @_) {
179
+ use File::Temp qw(tempfile);
180
+ my ($fhargs, $filename) =
181
+ tempfile('git-args-XXXXXX', UNLINK => 1);
182
+
183
+ my $cmd = 'cat '.$filename.' | xargs -0 -s 20000 ';
184
+ while ($_[0] ne '--') {
185
+ $cmd = $cmd . shift(@_) . ' ';
186
+ }
187
188
+ shift(@_);
189
+ print $fhargs join("\0", @_);
190
+ close($fhargs);
191
192
+ my $fh = undef;
193
+ open($fh, '-|', $cmd) or die;
194
+ return <$fh>;
195
} else {
196
my $fh = undef;
197
open($fh, '-|', @_) or die;
0 commit comments