summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-04-01 01:49:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-14 20:47:06 (GMT)
commitcb8388df5b3252802a0149ca558f99307e42074c (patch)
tree983f69d0eebc105adae45f73d0b803ba2e2e1225 /builtin/commit.c
parent0f6d3ba6bd795b09bf216c267bbf6e3ec2409d1e (diff)
downloadgit-cb8388df5b3252802a0149ca558f99307e42074c.zip
git-cb8388df5b3252802a0149ca558f99307e42074c.tar.gz
git-cb8388df5b3252802a0149ca558f99307e42074c.tar.bz2
commit: ensure full index
These two loops iterate over all cache entries, so ensure that a sparse index is expanded to a full index before we do so. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 739110c..cf0c36d 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -251,6 +251,8 @@ static int list_paths(struct string_list *list, const char *with_tree,
free(max_prefix);
}
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(&the_index);
for (i = 0; i < active_nr; i++) {
const struct cache_entry *ce = active_cache[i];
struct string_list_item *item;
@@ -931,6 +933,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (get_oid(parent, &oid)) {
int i, ita_nr = 0;
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(&the_index);
for (i = 0; i < active_nr; i++)
if (ce_intent_to_add(active_cache[i]))
ita_nr++;