From: Derrick Stolee Date: Thu, 1 Apr 2021 01:50:00 +0000 (+0000) Subject: revision: ensure full index X-Git-Tag: v2.32.0-rc0~59^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f5fed74fb2eac4d7c6fd4b09f2167b83942c0f13;p=thirdparty%2Fgit.git revision: ensure full index Before iterating over all index entries, ensure that a sparse index is expanded to a full index to avoid unexpected behavior. This case could be integrated later by ensuring that we walk the tree in the sparse-directory entry, but the current behavior is only expecting blobs. Save this integration for later when it can be properly tested. Signed-off-by: Derrick Stolee Reviewed-by: Elijah Newren Signed-off-by: Junio C Hamano --- diff --git a/revision.c b/revision.c index b78733f508..b72e0ac1bd 100644 --- a/revision.c +++ b/revision.c @@ -1680,6 +1680,8 @@ static void do_add_index_objects_to_pending(struct rev_info *revs, { int i; + /* TODO: audit for interaction with sparse-index. */ + ensure_full_index(istate); for (i = 0; i < istate->cache_nr; i++) { struct cache_entry *ce = istate->cache[i]; struct blob *blob;