Skip to content

Commit 8270201

Browse files
Eric Wonggitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d63586c commit 8270201

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

perl/Git.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ argument is required if you want to see the command name in the error message,
418418
and it is the fourth value returned by C<command_bidi_pipe()>. The call idiom
419419
is:
420420
421-
my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe('cat-file --batch-check');
421+
my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe(qw(cat-file --batch-check));
422422
print $out "000000000\n";
423423
while (<$in>) { ... }
424424
$r->command_close_bidi_pipe($pid, $in, $out, $ctx);
@@ -431,7 +431,7 @@ C<PIPE_IN> and C<PIPE_OUT> may be C<undef> if they have been closed prior to
431431
calling this function. This may be useful in a query-response type of
432432
commands where caller first writes a query and later reads response, eg:
433433
434-
my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe('cat-file --batch-check');
434+
my ($pid, $in, $out, $ctx) = $r->command_bidi_pipe(qw(cat-file --batch-check));
435435
print $out "000000000\n";
436436
close $out;
437437
while (<$in>) { ... }

0 commit comments

Comments
 (0)