diff --git a/reachable.c b/reachable.c index d4507c4270..aba63ebeb3 100644 --- a/reachable.c +++ b/reachable.c @@ -13,6 +13,7 @@ #include "worktree.h" #include "object-store.h" #include "pack-bitmap.h" +#include "pack-mtimes.h" struct connectivity_progress { struct progress *progress; @@ -155,6 +156,7 @@ static int add_recent_packed(const struct object_id *oid, void *data) { struct object *obj; + timestamp_t mtime = p->mtime; if (!want_recent_object(data, oid)) return 0; @@ -163,7 +165,12 @@ static int add_recent_packed(const struct object_id *oid, if (obj && obj->flags & SEEN) return 0; - add_recent_object(oid, p, nth_packed_object_offset(p, pos), p->mtime, data); + if (p->is_cruft) { + if (load_pack_mtimes(p) < 0) + die(_("could not load cruft pack .mtimes")); + mtime = nth_packed_mtime(p, pos); + } + add_recent_object(oid, p, nth_packed_object_offset(p, pos), mtime, data); return 0; }