path: root/attr.c
diff options
authorJohannes Schindelin <>2018-05-02 09:38:39 (GMT)
committerJunio C Hamano <>2018-05-06 10:06:13 (GMT)
commit033abf97fcbc247eabf915780181d947cfb66205 (patch)
tree3bc9fcff58ff630c3d94fbd5535f29948b2b0ef0 /attr.c
parentdde74d732fc3c5fa4bc4238aa935c164ff6c2dd5 (diff)
Replace all die("BUG: ...") calls by BUG() ones
In d8193743e08 (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 in 588a538ae55 (setup_git_env: convert die("BUG") to BUG(), 2017-05-12). The cover letter of the patch series containing this patch (cf 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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'attr.c')
1 files changed, 5 insertions, 5 deletions
diff --git a/attr.c b/attr.c
index 03a678f..067fb9e 100644
--- a/attr.c
+++ b/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)
if (i >=
- die("BUG: no entry found");
+ BUG("no entry found");
/* shift entries over */
for (; i < - 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;
@@ -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)