git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv2 1/5] Git.pm: allow command_close_bidi_pipe to be called as method

From
MNMichal Nazarewicz <mpn@google.com>
Date
Feb 7, 2013, 14:01 UTC
Message-ID
<80ccd09ea28fe5282ec97f4d20896a9c55720913.1360242782.git.mina86@mina86.com>
In-Reply-To
<cover.1360242782.git.mina86@mina86.com>
From: Michal Nazarewicz <mina86@mina86.com>

The documentation of command_close_bidi_pipe() claims that it can be called as a method, but it does not check whether the first argument is $self or not assuming the latter. Using _maybe_self() fixes this.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
---
 perl/Git.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/perl/Git.pm b/perl/Git.pm
index 931047c..bbb753a 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -430,7 +430,7 @@ have more complicated structure.
 
 sub command_close_bidi_pipe {
 	local $?;
-	my ($pid, $in, $out, $ctx) = @_;
+	my ($self, $pid, $in, $out, $ctx) = _maybe_self(@_);
 	foreach my $fh ($in, $out) {
 		unless (close $fh) {
 			if ($!) {
-- 
1.8.1.2.549.g1d13f9f
Previous: Michal NazarewiczNext: Michal Nazarewicz
Message 2 of 11 in “[PATCHv2 0/5] Make git-send-email use git-credential”
  1. Michal NazarewiczFeb 7, 2013
  2. 1/5 Git.pm: allow command_close_bidi_pipe to be called as methodMichal Nazarewicz, Feb 7, 2013
  3. 2/5 Git.pm: fix example in command_close_bidi_pipe documentationMichal Nazarewicz, Feb 7, 2013
  4. 3/5 Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipeMichal Nazarewicz, Feb 7, 2013
  5. 4/5 Git.pm: add interface for git credential commandMichal Nazarewicz, Feb 7, 2013
  6. Matthieu MoyFeb 7, 2013
  7. Junio C HamanoFeb 7, 2013
  8. Michal NazarewiczFeb 8, 2013
  9. Jeff KingFeb 8, 2013
  10. 5/5 git-send-email: use git credential to obtain passwordMichal Nazarewicz, Feb 7, 2013
  11. Junio C HamanoFeb 7, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.