Replace all die("BUG: ...") calls by BUG() ones
Ind8193743e0
(usage.c: add BUG() function, 2017-05-12), a new macro was introduced to use for reporting bugs instead of die(). It was then subsequently used to convert one single caller in588a538ae5
(setup_git_env: convert die("BUG") to BUG(), 2017-05-12). The cover letter of the patch series containing this patch (cf 20170513032414.mfrwabt4hovujde2@sigill.intra.peff.net) is not terribly clear why only one call site was converted, or what the plan is for other, similar calls to die() to report bugs. Let's just convert all remaining ones in one fell swoop. This trick was performed by this invocation: sed -i 's/die("BUG: /BUG("/g' $(git grep -l 'die("BUG' \*.c) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
dde74d732f
commit
033abf97fc
10
attr.c
10
attr.c
@ -157,7 +157,7 @@ static void all_attrs_init(struct attr_hashmap *map, struct attr_check *check)
|
||||
|
||||
size = hashmap_get_size(&map->map);
|
||||
if (size < check->all_attrs_nr)
|
||||
die("BUG: interned attributes shouldn't be deleted");
|
||||
BUG("interned attributes shouldn't be deleted");
|
||||
|
||||
/*
|
||||
* If the number of attributes in the global dictionary has increased
|
||||
@ -541,7 +541,7 @@ static void check_vector_remove(struct attr_check *check)
|
||||
break;
|
||||
|
||||
if (i >= check_vector.nr)
|
||||
die("BUG: no entry found");
|
||||
BUG("no entry found");
|
||||
|
||||
/* shift entries over */
|
||||
for (; i < check_vector.nr - 1; i++)
|
||||
@ -599,11 +599,11 @@ struct attr_check *attr_check_initl(const char *one, ...)
|
||||
const struct git_attr *attr;
|
||||
param = va_arg(params, const char *);
|
||||
if (!param)
|
||||
die("BUG: counted %d != ended at %d",
|
||||
BUG("counted %d != ended at %d",
|
||||
check->nr, cnt);
|
||||
attr = git_attr(param);
|
||||
if (!attr)
|
||||
die("BUG: %s: not a valid attribute name", param);
|
||||
BUG("%s: not a valid attribute name", param);
|
||||
check->items[cnt].attr = attr;
|
||||
}
|
||||
va_end(params);
|
||||
@ -714,7 +714,7 @@ void git_attr_set_direction(enum git_attr_direction new_direction,
|
||||
struct index_state *istate)
|
||||
{
|
||||
if (is_bare_repository() && new_direction != GIT_ATTR_INDEX)
|
||||
die("BUG: non-INDEX attr direction in a bare repo");
|
||||
BUG("non-INDEX attr direction in a bare repo");
|
||||
|
||||
if (new_direction != direction)
|
||||
drop_all_attr_stacks();
|
||||
|
Reference in New Issue
Block a user