This improves fsck error reporting in a rather obscure edge case, and fixes up some object APIs along the way as needed. This is based on my series to add a bug() function: https://lore.kernel.org/git/cover-0.5-00000000000-20210328T022343Z-avarab@xxxxxxxxx/ The use of the new bug() function is in 5/5. Ævar Arnfjörð Bjarmason (5): cache.h: move object functions to object-store.h fsck tests: refactor one test to use a sub-repo fsck: don't hard die on invalid object types fsck: improve the error on invalid object types fsck: improve error on loose object hash mismatch builtin/cat-file.c | 7 +++-- builtin/fast-export.c | 2 +- builtin/fsck.c | 28 ++++++++++++++--- builtin/index-pack.c | 2 +- builtin/mktag.c | 3 +- cache.h | 10 ------ object-file.c | 73 +++++++++++++++++++++++-------------------- object-store.h | 19 +++++++++-- object.c | 4 +-- pack-check.c | 3 +- streaming.c | 5 ++- t/t1450-fsck.sh | 64 +++++++++++++++++++++++++++---------- 12 files changed, 143 insertions(+), 77 deletions(-) -- 2.31.1.445.g91d8e479b0a