blob: c0e8ad670d0a17a28fd049b6814d8e77c7654dc2 [file] [log] [blame]
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +07001#include "cache.h"
2#include "split-index.h"
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +07003#include "ewah/ewok.h"
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +07004
5struct split_index *init_split_index(struct index_state *istate)
6{
7 if (!istate->split_index) {
8 istate->split_index = xcalloc(1, sizeof(*istate->split_index));
9 istate->split_index->refcount = 1;
10 }
11 return istate->split_index;
12}
13
14int read_link_extension(struct index_state *istate,
15 const void *data_, unsigned long sz)
16{
17 const unsigned char *data = data_;
18 struct split_index *si;
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +070019 int ret;
20
brian m. carlson2182abd2018-05-02 00:25:43 +000021 if (sz < the_hash_algo->rawsz)
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +070022 return error("corrupt link extension (too short)");
23 si = init_split_index(istate);
brian m. carlson2182abd2018-05-02 00:25:43 +000024 hashcpy(si->base_oid.hash, data);
25 data += the_hash_algo->rawsz;
26 sz -= the_hash_algo->rawsz;
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +070027 if (!sz)
28 return 0;
29 si->delete_bitmap = ewah_new();
30 ret = ewah_read_mmap(si->delete_bitmap, data, sz);
31 if (ret < 0)
32 return error("corrupt delete bitmap in link extension");
33 data += ret;
34 sz -= ret;
35 si->replace_bitmap = ewah_new();
36 ret = ewah_read_mmap(si->replace_bitmap, data, sz);
37 if (ret < 0)
38 return error("corrupt replace bitmap in link extension");
39 if (ret != sz)
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +070040 return error("garbage at the end of link extension");
41 return 0;
42}
43
44int write_link_extension(struct strbuf *sb,
45 struct index_state *istate)
46{
47 struct split_index *si = istate->split_index;
brian m. carlson2182abd2018-05-02 00:25:43 +000048 strbuf_add(sb, si->base_oid.hash, the_hash_algo->rawsz);
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +070049 if (!si->delete_bitmap && !si->replace_bitmap)
50 return 0;
Nguyễn Thái Ngọc Duybe0d9d52015-03-08 17:12:32 +070051 ewah_serialize_strbuf(si->delete_bitmap, sb);
52 ewah_serialize_strbuf(si->replace_bitmap, sb);
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +070053 return 0;
54}
55
56static void mark_base_index_entries(struct index_state *base)
57{
58 int i;
59 /*
60 * To keep track of the shared entries between
61 * istate->base->cache[] and istate->cache[], base entry
62 * position is stored in each base entry. All positions start
Li Peng832c0e52016-05-06 20:36:46 +080063 * from 1 instead of 0, which is reserved to say "this is a new
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +070064 * entry".
65 */
66 for (i = 0; i < base->cache_nr; i++)
67 base->cache[i]->index = i + 1;
68}
69
Nguyễn Thái Ngọc Duyc18b80a2014-06-13 19:19:44 +070070void move_cache_to_base_index(struct index_state *istate)
71{
72 struct split_index *si = istate->split_index;
73 int i;
74
75 /*
Jameson Miller8e72d672018-07-02 19:49:37 +000076 * If there was a previous base index, then transfer ownership of allocated
77 * entries to the parent index.
Nguyễn Thái Ngọc Duyc18b80a2014-06-13 19:19:44 +070078 */
Jameson Miller8e72d672018-07-02 19:49:37 +000079 if (si->base &&
80 si->base->ce_mem_pool) {
81
Elijah Newren44c7e1a2020-08-15 17:37:56 +000082 if (!istate->ce_mem_pool) {
83 istate->ce_mem_pool = xmalloc(sizeof(struct mem_pool));
84 mem_pool_init(istate->ce_mem_pool, 0);
85 }
Jameson Miller8e72d672018-07-02 19:49:37 +000086
87 mem_pool_combine(istate->ce_mem_pool, istate->split_index->base->ce_mem_pool);
88 }
89
Nguyễn Thái Ngọc Duyc18b80a2014-06-13 19:19:44 +070090 si->base = xcalloc(1, sizeof(*si->base));
91 si->base->version = istate->version;
92 /* zero timestamp disables racy test in ce_write_index() */
93 si->base->timestamp = istate->timestamp;
94 ALLOC_GROW(si->base->cache, istate->cache_nr, si->base->cache_alloc);
95 si->base->cache_nr = istate->cache_nr;
Jameson Miller8e72d672018-07-02 19:49:37 +000096
97 /*
98 * The mem_pool needs to move with the allocated entries.
99 */
100 si->base->ce_mem_pool = istate->ce_mem_pool;
101 istate->ce_mem_pool = NULL;
102
René Scharfe45ccef82016-09-25 09:24:03 +0200103 COPY_ARRAY(si->base->cache, istate->cache, istate->cache_nr);
Nguyễn Thái Ngọc Duyc18b80a2014-06-13 19:19:44 +0700104 mark_base_index_entries(si->base);
105 for (i = 0; i < si->base->cache_nr; i++)
106 si->base->cache[i]->ce_flags &= ~CE_UPDATE_IN_BASE;
107}
108
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700109static void mark_entry_for_delete(size_t pos, void *data)
110{
111 struct index_state *istate = data;
112 if (pos >= istate->cache_nr)
113 die("position for delete %d exceeds base index size %d",
114 (int)pos, istate->cache_nr);
115 istate->cache[pos]->ce_flags |= CE_REMOVE;
SZEDER Gábor2034e842018-10-11 11:43:07 +0200116 istate->split_index->nr_deletions++;
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700117}
118
119static void replace_entry(size_t pos, void *data)
120{
121 struct index_state *istate = data;
122 struct split_index *si = istate->split_index;
123 struct cache_entry *dst, *src;
Nguyễn Thái Ngọc Duyb3c96fb2014-06-13 19:19:43 +0700124
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700125 if (pos >= istate->cache_nr)
126 die("position for replacement %d exceeds base index size %d",
127 (int)pos, istate->cache_nr);
128 if (si->nr_replacements >= si->saved_cache_nr)
129 die("too many replacements (%d vs %d)",
130 si->nr_replacements, si->saved_cache_nr);
131 dst = istate->cache[pos];
132 if (dst->ce_flags & CE_REMOVE)
133 die("entry %d is marked as both replaced and deleted",
134 (int)pos);
135 src = si->saved_cache[si->nr_replacements];
Nguyễn Thái Ngọc Duyb3c96fb2014-06-13 19:19:43 +0700136 if (ce_namelen(src))
137 die("corrupt link extension, entry %d should have "
138 "zero length name", (int)pos);
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700139 src->index = pos + 1;
140 src->ce_flags |= CE_UPDATE_IN_BASE;
Nguyễn Thái Ngọc Duyb3c96fb2014-06-13 19:19:43 +0700141 src->ce_namelen = dst->ce_namelen;
142 copy_cache_entry(dst, src);
Jameson Millera8497352018-07-02 19:49:31 +0000143 discard_cache_entry(src);
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700144 si->nr_replacements++;
145}
146
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +0700147void merge_base_index(struct index_state *istate)
148{
149 struct split_index *si = istate->split_index;
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700150 unsigned int i;
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +0700151
152 mark_base_index_entries(si->base);
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700153
154 si->saved_cache = istate->cache;
155 si->saved_cache_nr = istate->cache_nr;
156 istate->cache_nr = si->base->cache_nr;
157 istate->cache = NULL;
158 istate->cache_alloc = 0;
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +0700159 ALLOC_GROW(istate->cache, istate->cache_nr, istate->cache_alloc);
René Scharfe45ccef82016-09-25 09:24:03 +0200160 COPY_ARRAY(istate->cache, si->base->cache, istate->cache_nr);
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700161
162 si->nr_deletions = 0;
163 si->nr_replacements = 0;
164 ewah_each_bit(si->replace_bitmap, replace_entry, istate);
165 ewah_each_bit(si->delete_bitmap, mark_entry_for_delete, istate);
166 if (si->nr_deletions)
Thomas Gummerer6fdc2052018-12-20 13:48:16 +0000167 remove_marked_cache_entries(istate, 0);
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700168
169 for (i = si->nr_replacements; i < si->saved_cache_nr; i++) {
Nguyễn Thái Ngọc Duyb3c96fb2014-06-13 19:19:43 +0700170 if (!ce_namelen(si->saved_cache[i]))
171 die("corrupt link extension, entry %d should "
172 "have non-zero length name", i);
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700173 add_index_entry(istate, si->saved_cache[i],
174 ADD_CACHE_OK_TO_ADD |
Nguyễn Thái Ngọc Duyce7c6142014-06-13 19:19:42 +0700175 ADD_CACHE_KEEP_CACHE_TREE |
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700176 /*
177 * we may have to replay what
178 * merge-recursive.c:update_stages()
179 * does, which has this flag on
180 */
181 ADD_CACHE_SKIP_DFCHECK);
182 si->saved_cache[i] = NULL;
183 }
184
185 ewah_free(si->delete_bitmap);
186 ewah_free(si->replace_bitmap);
Ævar Arnfjörð Bjarmason88ce3ef2017-06-15 23:15:49 +0000187 FREE_AND_NULL(si->saved_cache);
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700188 si->delete_bitmap = NULL;
189 si->replace_bitmap = NULL;
Nguyễn Thái Ngọc Duy76b07b32014-06-13 19:19:41 +0700190 si->saved_cache_nr = 0;
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +0700191}
192
SZEDER Gábore3d83792018-10-11 11:43:08 +0200193/*
194 * Compare most of the fields in two cache entries, i.e. all except the
195 * hashmap_entry and the name.
196 */
197static int compare_ce_content(struct cache_entry *a, struct cache_entry *b)
198{
199 const unsigned int ondisk_flags = CE_STAGEMASK | CE_VALID |
200 CE_EXTENDED_FLAGS;
201 unsigned int ce_flags = a->ce_flags;
202 unsigned int base_flags = b->ce_flags;
203 int ret;
204
205 /* only on-disk flags matter */
206 a->ce_flags &= ondisk_flags;
207 b->ce_flags &= ondisk_flags;
208 ret = memcmp(&a->ce_stat_data, &b->ce_stat_data,
209 offsetof(struct cache_entry, name) -
210 offsetof(struct cache_entry, ce_stat_data));
211 a->ce_flags = ce_flags;
212 b->ce_flags = base_flags;
213
214 return ret;
215}
216
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +0700217void prepare_to_write_split_index(struct index_state *istate)
218{
219 struct split_index *si = init_split_index(istate);
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700220 struct cache_entry **entries = NULL, *ce;
221 int i, nr_entries = 0, nr_alloc = 0;
222
223 si->delete_bitmap = ewah_new();
224 si->replace_bitmap = ewah_new();
225
226 if (si->base) {
227 /* Go through istate->cache[] and mark CE_MATCHED to
228 * entry with positive index. We'll go through
229 * base->cache[] later to delete all entries in base
Christian Couder753c4512016-10-23 11:26:30 +0200230 * that are not marked with either CE_MATCHED or
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700231 * CE_UPDATE_IN_BASE. If istate->cache[i] is a
232 * duplicate, deduplicate it.
233 */
234 for (i = 0; i < istate->cache_nr; i++) {
235 struct cache_entry *base;
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700236 ce = istate->cache[i];
SZEDER Gábore3d83792018-10-11 11:43:08 +0200237 if (!ce->index) {
238 /*
239 * During simple update index operations this
240 * is a cache entry that is not present in
241 * the shared index. It will be added to the
242 * split index.
243 *
244 * However, it might also represent a file
245 * that already has a cache entry in the
246 * shared index, but a new index has just
247 * been constructed by unpack_trees(), and
248 * this entry now refers to different content
249 * than what was recorded in the original
250 * index, e.g. during 'read-tree -m HEAD^' or
251 * 'checkout HEAD^'. In this case the
252 * original entry in the shared index will be
253 * marked as deleted, and this entry will be
254 * added to the split index.
255 */
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700256 continue;
SZEDER Gábore3d83792018-10-11 11:43:08 +0200257 }
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700258 if (ce->index > si->base->cache_nr) {
SZEDER Gábor4c490f32018-10-11 11:53:57 +0200259 BUG("ce refers to a shared ce at %d, which is beyond the shared index size %d",
260 ce->index, si->base->cache_nr);
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700261 }
262 ce->ce_flags |= CE_MATCHED; /* or "shared" */
263 base = si->base->cache[ce->index - 1];
SZEDER Gábor5581a012018-10-11 11:43:09 +0200264 if (ce == base) {
265 /* The entry is present in the shared index. */
266 if (ce->ce_flags & CE_UPDATE_IN_BASE) {
267 /*
268 * Already marked for inclusion in
269 * the split index, either because
270 * the corresponding file was
271 * modified and the cached stat data
272 * was refreshed, or because there
273 * is already a replacement entry in
274 * the split index.
275 * Nothing more to do here.
276 */
277 } else if (!ce_uptodate(ce) &&
278 is_racy_timestamp(istate, ce)) {
279 /*
280 * A racily clean cache entry stored
281 * only in the shared index: it must
282 * be added to the split index, so
283 * the subsequent do_write_index()
284 * can smudge its stat data.
285 */
286 ce->ce_flags |= CE_UPDATE_IN_BASE;
287 } else {
288 /*
289 * The entry is only present in the
290 * shared index and it was not
291 * refreshed.
292 * Just leave it there.
293 */
294 }
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700295 continue;
SZEDER Gábor5581a012018-10-11 11:43:09 +0200296 }
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700297 if (ce->ce_namelen != base->ce_namelen ||
298 strcmp(ce->name, base->name)) {
299 ce->index = 0;
300 continue;
301 }
SZEDER Gábore3d83792018-10-11 11:43:08 +0200302 /*
303 * This is the copy of a cache entry that is present
304 * in the shared index, created by unpack_trees()
305 * while it constructed a new index.
306 */
307 if (ce->ce_flags & CE_UPDATE_IN_BASE) {
308 /*
309 * Already marked for inclusion in the split
310 * index, either because the corresponding
311 * file was modified and the cached stat data
312 * was refreshed, or because the original
313 * entry already had a replacement entry in
314 * the split index.
315 * Nothing to do.
316 */
SZEDER Gábor5581a012018-10-11 11:43:09 +0200317 } else if (!ce_uptodate(ce) &&
318 is_racy_timestamp(istate, ce)) {
319 /*
320 * A copy of a racily clean cache entry from
321 * the shared index. It must be added to
322 * the split index, so the subsequent
323 * do_write_index() can smudge its stat data.
324 */
325 ce->ce_flags |= CE_UPDATE_IN_BASE;
SZEDER Gábore3d83792018-10-11 11:43:08 +0200326 } else {
327 /*
328 * Thoroughly compare the cached data to see
329 * whether it should be marked for inclusion
330 * in the split index.
331 *
332 * This comparison might be unnecessary, as
333 * code paths modifying the cached data do
334 * set CE_UPDATE_IN_BASE as well.
335 */
336 if (compare_ce_content(ce, base))
337 ce->ce_flags |= CE_UPDATE_IN_BASE;
338 }
Jameson Millera8497352018-07-02 19:49:31 +0000339 discard_cache_entry(base);
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700340 si->base->cache[ce->index - 1] = ce;
341 }
342 for (i = 0; i < si->base->cache_nr; i++) {
343 ce = si->base->cache[i];
344 if ((ce->ce_flags & CE_REMOVE) ||
345 !(ce->ce_flags & CE_MATCHED))
346 ewah_set(si->delete_bitmap, i);
347 else if (ce->ce_flags & CE_UPDATE_IN_BASE) {
348 ewah_set(si->replace_bitmap, i);
Nguyễn Thái Ngọc Duyb3c96fb2014-06-13 19:19:43 +0700349 ce->ce_flags |= CE_STRIP_NAME;
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700350 ALLOC_GROW(entries, nr_entries+1, nr_alloc);
351 entries[nr_entries++] = ce;
352 }
Thomas Gummerer4bddd982018-01-07 22:30:14 +0000353 if (is_null_oid(&ce->oid))
354 istate->drop_cache_tree = 1;
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700355 }
356 }
357
358 for (i = 0; i < istate->cache_nr; i++) {
359 ce = istate->cache[i];
360 if ((!si->base || !ce->index) && !(ce->ce_flags & CE_REMOVE)) {
Nguyễn Thái Ngọc Duyb3c96fb2014-06-13 19:19:43 +0700361 assert(!(ce->ce_flags & CE_STRIP_NAME));
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700362 ALLOC_GROW(entries, nr_entries+1, nr_alloc);
363 entries[nr_entries++] = ce;
364 }
365 ce->ce_flags &= ~CE_MATCHED;
366 }
367
368 /*
369 * take cache[] out temporarily, put entries[] in its place
370 * for writing
371 */
372 si->saved_cache = istate->cache;
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +0700373 si->saved_cache_nr = istate->cache_nr;
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700374 istate->cache = entries;
375 istate->cache_nr = nr_entries;
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +0700376}
377
378void finish_writing_split_index(struct index_state *istate)
379{
380 struct split_index *si = init_split_index(istate);
Nguyễn Thái Ngọc Duy96a1d8d2014-06-13 19:19:40 +0700381
382 ewah_free(si->delete_bitmap);
383 ewah_free(si->replace_bitmap);
384 si->delete_bitmap = NULL;
385 si->replace_bitmap = NULL;
386 free(istate->cache);
387 istate->cache = si->saved_cache;
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +0700388 istate->cache_nr = si->saved_cache_nr;
389}
390
391void discard_split_index(struct index_state *istate)
392{
393 struct split_index *si = istate->split_index;
394 if (!si)
395 return;
396 istate->split_index = NULL;
397 si->refcount--;
398 if (si->refcount)
399 return;
400 if (si->base) {
401 discard_index(si->base);
402 free(si->base);
403 }
404 free(si);
405}
Nguyễn Thái Ngọc Duy045113a2014-06-13 19:19:38 +0700406
407void save_or_free_index_entry(struct index_state *istate, struct cache_entry *ce)
408{
409 if (ce->index &&
410 istate->split_index &&
411 istate->split_index->base &&
412 ce->index <= istate->split_index->base->cache_nr &&
413 ce == istate->split_index->base->cache[ce->index - 1])
414 ce->ce_flags |= CE_REMOVE;
415 else
Jameson Millera8497352018-07-02 19:49:31 +0000416 discard_cache_entry(ce);
Nguyễn Thái Ngọc Duy045113a2014-06-13 19:19:38 +0700417}
Nguyễn Thái Ngọc Duy078a58e2014-06-13 19:19:39 +0700418
419void replace_index_entry_in_base(struct index_state *istate,
Brandon Williams75b7b972018-02-14 10:59:48 -0800420 struct cache_entry *old_entry,
421 struct cache_entry *new_entry)
Nguyễn Thái Ngọc Duy078a58e2014-06-13 19:19:39 +0700422{
Brandon Williams75b7b972018-02-14 10:59:48 -0800423 if (old_entry->index &&
Nguyễn Thái Ngọc Duy078a58e2014-06-13 19:19:39 +0700424 istate->split_index &&
425 istate->split_index->base &&
Brandon Williams75b7b972018-02-14 10:59:48 -0800426 old_entry->index <= istate->split_index->base->cache_nr) {
427 new_entry->index = old_entry->index;
428 if (old_entry != istate->split_index->base->cache[new_entry->index - 1])
Jameson Millera8497352018-07-02 19:49:31 +0000429 discard_cache_entry(istate->split_index->base->cache[new_entry->index - 1]);
Brandon Williams75b7b972018-02-14 10:59:48 -0800430 istate->split_index->base->cache[new_entry->index - 1] = new_entry;
Nguyễn Thái Ngọc Duy078a58e2014-06-13 19:19:39 +0700431 }
432}
Christian Coudercef4fc72017-02-27 19:00:01 +0100433
434void add_split_index(struct index_state *istate)
435{
436 if (!istate->split_index) {
437 init_split_index(istate);
438 istate->cache_changed |= SPLIT_INDEX_ORDERED;
439 }
440}
441
442void remove_split_index(struct index_state *istate)
443{
Junio C Hamano64719b12017-06-24 12:02:39 -0700444 if (istate->split_index) {
Nguyễn Thái Ngọc Duy6e37c8e2019-02-13 16:51:29 +0700445 if (istate->split_index->base) {
446 /*
447 * When removing the split index, we need to move
448 * ownership of the mem_pool associated with the
449 * base index to the main index. There may be cache entries
450 * allocated from the base's memory pool that are shared with
451 * the_index.cache[].
452 */
453 mem_pool_combine(istate->ce_mem_pool,
454 istate->split_index->base->ce_mem_pool);
Jameson Miller8e72d672018-07-02 19:49:37 +0000455
Nguyễn Thái Ngọc Duy6e37c8e2019-02-13 16:51:29 +0700456 /*
457 * The split index no longer owns the mem_pool backing
458 * its cache array. As we are discarding this index,
459 * mark the index as having no cache entries, so it
460 * will not attempt to clean up the cache entries or
461 * validate them.
462 */
Jameson Miller8e72d672018-07-02 19:49:37 +0000463 istate->split_index->base->cache_nr = 0;
Nguyễn Thái Ngọc Duy6e37c8e2019-02-13 16:51:29 +0700464 }
Jameson Miller8e72d672018-07-02 19:49:37 +0000465
466 /*
467 * We can discard the split index because its
468 * memory pool has been incorporated into the
469 * memory pool associated with the the_index.
470 */
471 discard_split_index(istate);
472
Junio C Hamano64719b12017-06-24 12:02:39 -0700473 istate->cache_changed |= SOMETHING_CHANGED;
474 }
Christian Coudercef4fc72017-02-27 19:00:01 +0100475}