git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo L. de M. Chaves" <gnustavo@cpan.org>
To: git@vger.kernel.org
Cc: "Gustavo L. de M. Chaves" <gnustavo@cpan.org>
Subject: [PATCH 3/7] perl/Git.pm: fix _cmd_close on Windows
Date: Wed, 30 Jan 2013 15:22:59 -0200	[thread overview]
Message-ID: <1359566583-19654-4-git-send-email-gnustavo@cpan.org> (raw)
In-Reply-To: <1359566583-19654-1-git-send-email-gnustavo@cpan.org>

From: "Gustavo L. de M. Chaves" <gnustavo@cpan.org>

The Git::activestate_pipe::CLOSE routine wasn't explicitly returning
anything. This means that on Windows the routine _cmd_close wasn't
checking correctly the external command's exit code.

Now we store the command's exit code on the object created by
Git::activestate_pipe::TIEHANDLE and return a sensible value on
Git::activestate_pipe::CLOSE to _cmd_close.

Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org>
---
 perl/Git.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/perl/Git.pm b/perl/Git.pm
index e14b41a..ef3134b 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -1404,7 +1404,7 @@ sub TIEHANDLE {
 	# Let's just hope ActiveState Perl does at least the quoting
 	# correctly.
 	my @data = qx{git @params};
-	bless { i => 0, data => \@data }, $class;
+	bless { i => 0, data => \@data, exit => $? }, $class;
 }
 
 sub READLINE {
@@ -1425,6 +1425,7 @@ sub CLOSE {
 	my $self = shift;
 	delete $self->{data};
 	delete $self->{i};
+	return $self->{exit} == 0;
 }
 
 sub EOF {
-- 
1.7.12.464.g83379df.dirty

  parent reply	other threads:[~2013-01-30 17:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 17:22 [PATCH 0/7] perl/Git.pm: a bunch of fixes for Windows Gustavo L. de M. Chaves
2013-01-30 17:22 ` [PATCH 1/7] perl/Git.pm: test portably if a path is absolute Gustavo L. de M. Chaves
2013-01-30 17:22 ` [PATCH 2/7] perl/Git.pm: set up command environment on Windows Gustavo L. de M. Chaves
2013-01-30 17:22 ` Gustavo L. de M. Chaves [this message]
2013-01-30 17:23 ` [PATCH 4/7] perl/Git.pm: escape external command's arguments " Gustavo L. de M. Chaves
2013-01-30 17:23 ` [PATCH 5/7] perl/Git.pm: simplify Git::activestate_pipe Gustavo L. de M. Chaves
2013-01-30 17:23 ` [PATCH 6/7] perl/Git.pm: make command pipe work in slurp-mode on Windows Gustavo L. de M. Chaves
2013-01-30 17:23 ` [PATCH 7/7] perl/Git.pm: rename 'ActiveState' to 'Windows' Gustavo L. de M. Chaves
2013-02-25  6:54 ` [PATCH 0/7] perl/Git.pm: a bunch of fixes for Windows Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359566583-19654-4-git-send-email-gnustavo@cpan.org \
    --to=gnustavo@cpan.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).