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
12
diff.c
12
diff.c
@ -1184,7 +1184,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
|
||||
fputs(o->stat_sep, o->file);
|
||||
break;
|
||||
default:
|
||||
die("BUG: unknown diff symbol");
|
||||
BUG("unknown diff symbol");
|
||||
}
|
||||
strbuf_release(&sb);
|
||||
}
|
||||
@ -1343,7 +1343,7 @@ static struct diff_tempfile *claim_diff_tempfile(void) {
|
||||
for (i = 0; i < ARRAY_SIZE(diff_temp); i++)
|
||||
if (!diff_temp[i].name)
|
||||
return diff_temp + i;
|
||||
die("BUG: diff is failing to clean up its tempfiles");
|
||||
BUG("diff is failing to clean up its tempfiles");
|
||||
}
|
||||
|
||||
static void remove_tempfile(void)
|
||||
@ -3840,7 +3840,7 @@ static const char *diff_abbrev_oid(const struct object_id *oid, int abbrev)
|
||||
if (abbrev < 0)
|
||||
abbrev = FALLBACK_DEFAULT_ABBREV;
|
||||
if (abbrev > GIT_SHA1_HEXSZ)
|
||||
die("BUG: oid abbreviation out of range: %d", abbrev);
|
||||
BUG("oid abbreviation out of range: %d", abbrev);
|
||||
if (abbrev)
|
||||
hex[abbrev] = '\0';
|
||||
return hex;
|
||||
@ -4334,7 +4334,7 @@ static int stat_opt(struct diff_options *options, const char **av)
|
||||
int argcount = 1;
|
||||
|
||||
if (!skip_prefix(arg, "--stat", &arg))
|
||||
die("BUG: stat option does not begin with --stat: %s", arg);
|
||||
BUG("stat option does not begin with --stat: %s", arg);
|
||||
end = (char *)arg;
|
||||
|
||||
switch (*arg) {
|
||||
@ -5519,7 +5519,7 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)
|
||||
struct diff_queue_struct *q = &diff_queued_diff;
|
||||
|
||||
if (WSEH_NEW & WS_RULE_MASK)
|
||||
die("BUG: WS rules bit mask overlaps with diff symbol flags");
|
||||
BUG("WS rules bit mask overlaps with diff symbol flags");
|
||||
|
||||
if (o->color_moved)
|
||||
o->emitted_symbols = &esm;
|
||||
@ -6053,7 +6053,7 @@ size_t fill_textconv(struct userdiff_driver *driver,
|
||||
}
|
||||
|
||||
if (!driver->textconv)
|
||||
die("BUG: fill_textconv called with non-textconv driver");
|
||||
BUG("fill_textconv called with non-textconv driver");
|
||||
|
||||
if (driver->textconv_cache && df->oid_valid) {
|
||||
*outbuf = notes_cache_get(driver->textconv_cache,
|
||||
|
||||
Reference in New Issue
Block a user