diff mbox series

[v2,05/16] read-cache.c: turn die("internal error") to BUG()

Message ID 20181105192059.20303-6-pclouds@gmail.com (mailing list archive)
State New, archived
Headers show
Series Mark more strings for translation | expand

Commit Message

Duy Nguyen Nov. 5, 2018, 7:20 p.m. UTC
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 read-cache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Junio C Hamano Nov. 6, 2018, 2:10 a.m. UTC | #1
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  read-cache.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Makes sense; thanks.

>
> diff --git a/read-cache.c b/read-cache.c
> index d57958233e..0c37f4885e 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -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");
>  			}
>  		}
>  	}
diff mbox series

Patch

diff --git a/read-cache.c b/read-cache.c
index d57958233e..0c37f4885e 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -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");
 			}
 		}
 	}