From: Junio C Hamano <gitster@pobox.com>
To: "Marco Costalba" <mcostalba@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>, "Nicolas Pitre" <nico@cam.org>
Subject: Re: [PATCH 6/6] Use new compress helpers in builtin-pack-objects.c
Date: Thu, 10 Jan 2008 23:26:09 -0800 [thread overview]
Message-ID: <7vir204ycu.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <e5bfff550801102210g181a091s28725e24922b9b12@mail.gmail.com> (Marco Costalba's message of "Fri, 11 Jan 2008 07:10:49 +0100")
"Marco Costalba" <mcostalba@gmail.com> writes:
> On Jan 10, 2008 10:34 PM, Marco Costalba <mcostalba@gmail.com> wrote:
>>
>> - while (deflate(&stream, Z_FINISH) == Z_OK)
>> - /* nothing */;
>> - deflateEnd(&stream);
>> - datalen = stream.total_out;
>> - deflateEnd(&stream);
>
>
> One thing I would like someone to clarify is why deflateEnd(&stream)
> is called two times ?
I'd call it an insufficient reviewing while accepting
http://thread.gmane.org/gmane.comp.version-control.git/45996
In fact, the second deflateEnd() has always been returning
Z_STREAM_ERROR. We just never checked the error return from
that particular deflateEnd().
The first one returns 0 for success. We might want to tighten
the check even more to check that.
-- >8 --
pack-objects: remove redundant call to deflateEnd()
We somehow called deflateEnd() on a stream that we have called
deflateEnd() on already.
Noticed by Marco.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin-pack-objects.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index a39cb82..ec10238 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -445,7 +445,7 @@ static unsigned long write_object(struct sha1file *f,
/* nothing */;
deflateEnd(&stream);
datalen = stream.total_out;
- deflateEnd(&stream);
+
/*
* The object header is a byte of 'type' followed by zero or
* more bytes of length.
prev parent reply other threads:[~2008-01-11 7:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 21:34 [PATCH 6/6] Use new compress helpers in builtin-pack-objects.c Marco Costalba
2008-01-10 22:26 ` Nicolas Pitre
2008-01-11 6:10 ` Marco Costalba
2008-01-11 7:26 ` Junio C Hamano [this message]
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=7vir204ycu.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mcostalba@gmail.com \
--cc=nico@cam.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).