From: Junio C Hamano Date: Tue, 26 Mar 2013 21:38:17 GMT Subject: Re: [PATCH v2 6/9] streaming_write_entry: propagate streaming errors Message-ID: <7vy5d9suye.fsf@alter.siamese.dyndns.org> In-Reply-To: <20130325214936.GA22419@sigill.intra.peff.net> Jeff King writes: > Subject: [PATCH] streaming_write_entry: propagate streaming errors > > When we are streaming an index blob to disk, we store the > error from stream_blob_to_fd in the "result" variable, and > then immediately overwrite that with the return value of > "close". That means we catch errors on close (e.g., problems > committing the file to disk), but miss anything which > happened before then. > > We can fix this by using bitwise-OR to accumulate errors in > our result variable. > > While we're here, we can also simplify the error handling > with an early return, which makes it easier to see under > which circumstances we need to clean up. > > Signed-off-by: Jeff King Very sensible. Thanks.