Skip to content

Commit 391408e

Browse files
pcloudsgitster
authored andcommitted
read-cache.c: turn die("internal error") to BUG()
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ad8f8f4 commit 391408e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

read-cache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static int ce_match_stat_basic(const struct cache_entry *ce, struct stat *st)
316316
changed |= DATA_CHANGED;
317317
return changed;
318318
default:
319-
die("internal error: ce_mode is %o", ce->ce_mode);
319+
BUG("unsupported ce_mode: %o", ce->ce_mode);
320320
}
321321

322322
changed |= match_stat_data(&ce->ce_stat_data, st);
@@ -2356,14 +2356,14 @@ void validate_cache_entries(const struct index_state *istate)
23562356

23572357
for (i = 0; i < istate->cache_nr; i++) {
23582358
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");
23602360
} else if (!istate->ce_mem_pool ||
23612361
!mem_pool_contains(istate->ce_mem_pool, istate->cache[i])) {
23622362
if (!istate->split_index ||
23632363
!istate->split_index->base ||
23642364
!istate->split_index->base->ce_mem_pool ||
23652365
!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");
23672367
}
23682368
}
23692369
}

0 commit comments

Comments
 (0)