diff options
Diffstat (limited to 'sparse-index.c')
-rw-r--r-- | sparse-index.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sparse-index.c b/sparse-index.c index 8c269dab80..147a13386a 100644 --- a/sparse-index.c +++ b/sparse-index.c @@ -128,9 +128,6 @@ int is_sparse_index_allowed(struct index_state *istate, int flags) if (!core_apply_sparse_checkout || !core_sparse_checkout_cone) return 0; - if (!istate->repo) - istate->repo = the_repository; - if (!(flags & SPARSE_INDEX_MEMORY_ONLY)) { int test_env; @@ -299,7 +296,7 @@ void expand_index(struct index_state *istate, struct pattern_list *pl) * If the index is already full, then keep it full. We will convert * it to a sparse index on write, if possible. */ - if (!istate || istate->sparse_index == INDEX_EXPANDED) + if (istate->sparse_index == INDEX_EXPANDED) return; /* @@ -327,9 +324,6 @@ void expand_index(struct index_state *istate, struct pattern_list *pl) pl = NULL; } - if (!istate->repo) - istate->repo = the_repository; - /* * A NULL pattern set indicates we are expanding a full index, so * we use a special region name that indicates the full expansion. @@ -424,6 +418,8 @@ void expand_index(struct index_state *istate, struct pattern_list *pl) void ensure_full_index(struct index_state *istate) { + if (!istate) + BUG("ensure_full_index() must get an index!"); expand_index(istate, NULL); } @@ -547,12 +543,9 @@ void expand_to_path(struct index_state *istate, if (in_expand_to_path) return; - if (!istate || !istate->sparse_index) + if (!istate->sparse_index) return; - if (!istate->repo) - istate->repo = the_repository; - in_expand_to_path = 1; /* |