Re: [PATCH] send-pack: use buffered I/O to talk to pack-objects
- From
Jeff King <peff@peff.net>
- Date
- Jun 9, 2016, 17:14 UTC
- Message-ID
- <20160609171429.GB9016@sigill.intra.peff.net>
- In-Reply-To
- <xmqqr3c6iad1.fsf@gitster.mtv.corp.google.com>
On Thu, Jun 09, 2016 at 09:40:42AM -0700, Junio C Hamano wrote:
Show 21 quoted lines
> >> for (i = 0; i < extra->nr; i++) > >> - if (!feed_object(extra->sha1[i], po.in, 1)) > >> - break; > >> + feed_object(extra->sha1[i], po_in, 1); > > > > I may have missed the obvious, but doesn't this change the behavior when > > "negative && !has_sha1_file(sha1)" happens? I understand that you don't > > need write_or_whine anymore, but don't understand how you get rid of the > > "return 1" here. > [...] > The original caller checks for errors to break out the feeding of > the process early, with things like: > > if (!feed_object(...)) > break; > > IOW, the caller would have continued when hitting that "return 1" > codepath. > > And the code with the patch, the caller continues unconditionally, > so there is no behaviour change, if I am reading the code correctly.
Right, that's my reading as well (and IMHO another good motivation for the patch, if it makes this all less confusing).
-Peff