read-cache.c: turn die("internal error") to BUG()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Nov 10, 2018 at 06:16 UTC 391408e532b9155eaad89f5f009549874d9a07e0
1 file changed +3 -3
read-cache.c
+3 -3
@@ -316,7 +316,7 @@ static int ce_match_stat_basic(const struct cache_entry *ce, struct stat *st)
316 changed |= DATA_CHANGED;
317 return changed;
318 default:
319 - die("internal error: ce_mode is %o", ce->ce_mode);
319 + BUG("unsupported ce_mode: %o", ce->ce_mode);
320 }
321
322 changed |= match_stat_data(&ce->ce_stat_data, st);
@@ -2356,14 +2356,14 @@ void validate_cache_entries(const struct index_state *istate)
2356
2357 for (i = 0; i < istate->cache_nr; i++) {
2358 if (!istate) {
2359 - die("internal error: cache entry is not allocated from expected memory pool");
2359 + BUG("cache entry is not allocated from expected memory pool");
2360 } else if (!istate->ce_mem_pool ||
2361 !mem_pool_contains(istate->ce_mem_pool, istate->cache[i])) {
2362 if (!istate->split_index ||
2363 !istate->split_index->base ||
2364 !istate->split_index->base->ce_mem_pool ||
2365 !mem_pool_contains(istate->split_index->base->ce_mem_pool, istate->cache[i])) {
2366 - die("internal error: cache entry is not allocated from expected memory pool");
2366 + BUG("cache entry is not allocated from expected memory pool");
2367 }
2368 }
2369 }