From 7260c37aa8c91c8008dcd2442a19c23d1c9040fb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 20 May 2024 07:14:39 +0200 Subject: Merging upstream version 1:2.45.1. Signed-off-by: Daniel Baumann --- rerere.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'rerere.c') diff --git a/rerere.c b/rerere.c index 09e1941..c7e1f8f 100644 --- a/rerere.c +++ b/rerere.c @@ -12,12 +12,10 @@ #include "dir.h" #include "resolve-undo.h" #include "merge-ll.h" -#include "attr.h" #include "path.h" #include "pathspec.h" #include "object-file.h" #include "object-store-ll.h" -#include "hash-lookup.h" #include "strmap.h" #define RESOLVED 0 @@ -221,6 +219,11 @@ static void read_rr(struct repository *r, struct string_list *rr) buf.buf[hexsz] = '\0'; id = new_rerere_id_hex(buf.buf); id->variant = variant; + /* + * make sure id->collection->status has enough space + * for the variant we are interested in + */ + fit_variant(id->collection, variant); string_list_insert(rr, path)->util = id; } strbuf_release(&buf); @@ -975,6 +978,9 @@ static int handle_cache(struct index_state *istate, mmfile[i].ptr = repo_read_object_file(the_repository, &ce->oid, &type, &size); + if (!mmfile[i].ptr) + die(_("unable to read %s"), + oid_to_hex(&ce->oid)); mmfile[i].size = size; } } -- cgit v1.2.3