]> git.ipfire.org Git - thirdparty/git.git/commitdiff
read-cache.c: turn die("internal error") to BUG()
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 10 Nov 2018 05:16:04 +0000 (06:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Nov 2018 05:47:09 +0000 (14:47 +0900)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c

index d57958233e82df6551fdc890f1238ae65beb8940..0c37f4885ec95ca42cb01da93e6c6cbc2b46ed75 100644 (file)
@@ -316,7 +316,7 @@ static int ce_match_stat_basic(const struct cache_entry *ce, struct stat *st)
                        changed |= DATA_CHANGED;
                return changed;
        default:
-               die("internal error: ce_mode is %o", ce->ce_mode);
+               BUG("unsupported ce_mode: %o", ce->ce_mode);
        }
 
        changed |= match_stat_data(&ce->ce_stat_data, st);
@@ -2356,14 +2356,14 @@ void validate_cache_entries(const struct index_state *istate)
 
        for (i = 0; i < istate->cache_nr; i++) {
                if (!istate) {
-                       die("internal error: cache entry is not allocated from expected memory pool");
+                       BUG("cache entry is not allocated from expected memory pool");
                } else if (!istate->ce_mem_pool ||
                        !mem_pool_contains(istate->ce_mem_pool, istate->cache[i])) {
                        if (!istate->split_index ||
                                !istate->split_index->base ||
                                !istate->split_index->base->ce_mem_pool ||
                                !mem_pool_contains(istate->split_index->base->ce_mem_pool, istate->cache[i])) {
-                               die("internal error: cache entry is not allocated from expected memory pool");
+                               BUG("cache entry is not allocated from expected memory pool");
                        }
                }
        }