mirror of
https://github.com/git/git.git
synced 2024-10-28 04:49:43 +01:00
Git.pm: use array in command_bidi_pipe example
command_bidi_pipe takes the git command and optional arguments as an array, not a string. Make sure the documentation example is usable code. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
d63586cb31
commit
8270201971
1 changed files with 2 additions and 2 deletions
|
@ -418,7 +418,7 @@ sub command_bidi_pipe {
|
|||
and it is the fourth value returned by C<command_bidi_pipe()>. The call idiom
|
||||
is:
|
||||
|
||||
my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe('cat-file --batch-check');
|
||||
my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe(qw(cat-file --batch-check));
|
||||
print $out "000000000\n";
|
||||
while (<$in>) { ... }
|
||||
$r->command_close_bidi_pipe($pid, $in, $out, $ctx);
|
||||
|
@ -431,7 +431,7 @@ sub command_bidi_pipe {
|
|||
calling this function. This may be useful in a query-response type of
|
||||
commands where caller first writes a query and later reads response, eg:
|
||||
|
||||
my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe('cat-file --batch-check');
|
||||
my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe(qw(cat-file --batch-check));
|
||||
print $out "000000000\n";
|
||||
close $out;
|
||||
while (<$in>) { ... }
|
||||
|
|
Loading…
Reference in a new issue