Re: [PATCH 10/15] use get_commit_buffer to avoid duplicate code

2014-06-10 Thread Jeff King
On Tue, Jun 10, 2014 at 04:01:29AM -0400, Eric Sunshine wrote: > > 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 fallb

Re: [PATCH 10/15] use get_commit_buffer to avoid duplicate code

2014-06-10 Thread Eric Sunshine
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()

[PATCH 10/15] use get_commit_buffer to avoid duplicate code

2014-06-09 Thread Jeff King
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.