Thanks everyone for your reviews. Here is a reroll with the requested change (just one small one). Jonathan Tan (4): object-file: reread object with exact same args object-file: refactor corrupt object diagnosis object-file: refactor replace object lookup commit: don't lazy-fetch commits commit.c | 18 ++++++++++++++-- object-file.c | 57 ++++++++++++++++++++++++++++++++++---------------- object-store.h | 10 +++++++++ 3 files changed, 65 insertions(+), 20 deletions(-) Range-diff against v1: 1: 604160e79c = 1: 604160e79c object-file: reread object with exact same args 2: a8c5fcd9f8 ! 2: 1be60f1bf2 object-file: refactor corrupt object diagnosis @@ object-file.c: void *read_object_file_extended(struct repository *r, /* die if we replaced an object with one that does not exist */ - if (repl != oid) -+ if (real_oid != oid) ++ if (!oideq(real_oid, oid)) die(_("replacement %s not found for %s"), - oid_to_hex(repl), oid_to_hex(oid)); + oid_to_hex(real_oid), oid_to_hex(oid)); 3: 940396307f = 3: 28935ba1b0 object-file: refactor replace object lookup 4: 6af8dcebd1 = 4: a38229c42a commit: don't lazy-fetch commits -- 2.39.0.rc0.267.gcb52ba06e7-goog