Git development
 help / color / mirror / Atom feed
From: "Ray Chuan" <rctay89@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] Git.pm: release hash and blob handles
Date: Sun, 12 Oct 2008 03:29:28 +0800	[thread overview]
Message-ID: <be6fef0d0810111229u60c28671w1afd952200c6fa23@mail.gmail.com> (raw)

the methods

 * hash_and_insert_object
 * cat_blob

use bidirectional pipes to pull/push data from the various git
utilities, but they don't close them after this is complete. this
denies Git's subsequent attempts to use these resources, leading to
failure.

a simple, reproducible test case can be seen at
http://rctay.spaces.live.com/blog/cns!59D3BFCD027B09E5!792.entry.

Signed-off-by: Tay Ray Chuan <rctay89 <at> gmail.com>
---
 perl/Git.pm |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/perl/Git.pm b/perl/Git.pm
index 6aab712..7e17f38 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -821,6 +821,7 @@ sub hash_and_insert_object {
 		throw Error::Simple("in pipe went bad");
 	}

+	$self->_close_hash_and_insert_object();
 	return $hash;
 }

@@ -910,6 +911,7 @@ sub cat_blob {
 		throw Error::Simple("couldn't write to passed in filehandle");
 	}

+	$self->_close_cat_blob();
 	return $size;
 }

--
1.6.0.2

             reply	other threads:[~2008-10-11 19:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-11 19:29 Ray Chuan [this message]
2008-10-11 21:23 ` [PATCH] Git.pm: release hash and blob handles Petr Baudis

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=be6fef0d0810111229u60c28671w1afd952200c6fa23@mail.gmail.com \
    --to=rctay89@gmail.com \
    --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