From: Eric Sunshine Date: Tue, 10 Jun 2014 08:01:29 GMT Subject: Re: [PATCH 10/15] use get_commit_buffer to avoid duplicate code Message-ID: In-Reply-To: <20140609181247.GJ20315@sigill.intra.peff.net> On Monday, June 9, 2014, Jeff King wrote: > For both of these sites, we already do the "fallback to > read_sha1_file" trick. But we can shorten the code by just > using get_commit_buffer. > > Note that the error cases are slightly different when > read_sha1_file fails. get_commit_buffer will die() if the > object cannot be loaded, or is a non-commit. > > For get_sha1_oneline, this will almost certainly never > happen, as we will have just called parse_object (and if it > does, it's probably worth complaining about). > > For record_author_date, the new behavior is probably better; > we notify the user of the error instead of silently ignoring > it. And because it's used only for sorting by author-date, > somebody examining a corrupt can fallback to the regular Missing word here? "examining a corrupt [...] can" > traversal order. > > Signed-off-by: Jeff King