Re: [PATCH] Git.pm: Fix internal git_command_bidi_pipe() users

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Monday, August 4, 2008 - 1:37 am

Petr Baudis <pasky@suse.cz> writes:


It is $gmane/91316, Message-ID: <20080804050247.GA13539@toroid.org>

After queueing it, I actually had to revert it, because it seems to break
git-svn (t9106-git-svn-commit-diff-clobber.sh, test #8), and I am about to
go to bed.  If you did not see the same breakage with your patch that does
not "fix" delete, it could be that the git-svn uses some of the resources
that are released by the delete actually doing what it is asked to do.

---

At 2008-08-04 12:49:27 +0800, rctay89@gmail.com wrote:

Yes, @vars would be interpreted in scalar context, which certainly isn't
the intended effect.

-- ams

 perl/Git.pm |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/perl/Git.pm b/perl/Git.pm
index 087d3d0..2ef437f 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -839,8 +839,8 @@ sub _close_hash_and_insert_object {
 
 	my @vars = map { 'hash_object_' . $_ } qw(pid in out ctx);
 
-	command_close_bidi_pipe($self->{@vars});
-	delete $self->{@vars};
+	command_close_bidi_pipe(@$self{@vars});
+	delete @$self{@vars};
 }
 
 =item cat_blob ( SHA1, FILEHANDLE )
@@ -928,8 +928,8 @@ sub _close_cat_blob {
 
 	my @vars = map { 'cat_blob_' . $_ } qw(pid in out ctx);
 
-	command_close_bidi_pipe($self->{@vars});
-	delete $self->{@vars};
+	command_close_bidi_pipe(@$self{@vars});
+	delete @$self{@vars};
 }
 
 =back
-- 
1.6.0.rc0.43.g2aa74
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[git/perl] unusual syntax?, Ray Chuan, (Sun Aug 3, 9:49 pm)
[PATCH] Fix hash slice syntax error, Abhijit Menon-Sen, (Sun Aug 3, 10:02 pm)
Re: [PATCH] Git.pm: Fix internal git_command_bidi_pipe() users, Junio C Hamano, (Mon Aug 4, 1:37 am)
[PATCH] Git.pm: localise $? in command_close_bidi_pipe(), Abhijit Menon-Sen, (Mon Aug 4, 4:38 am)
Re: [git/perl] unusual syntax?, David Christensen, (Mon Aug 4, 8:01 am)