summaryrefslogtreecommitdiff
path: root/builtin/fast-export.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-10 21:41:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-13 19:08:17 (GMT)
commitba41c1c93fd9109eae954f75a8cb8e32c3e29530 (patch)
treed4d5e92c25847777b54aabebeaf5cd6b6806b19f /builtin/fast-export.c
parenta97934d8205772ffd2a528a9e970af7dec725012 (diff)
downloadgit-ba41c1c93fd9109eae954f75a8cb8e32c3e29530.zip
git-ba41c1c93fd9109eae954f75a8cb8e32c3e29530.tar.gz
git-ba41c1c93fd9109eae954f75a8cb8e32c3e29530.tar.bz2
use get_commit_buffer to avoid duplicate code
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 repo can fallback to the regular traversal order. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fast-export.c')
0 files changed, 0 insertions, 0 deletions