die("bug"): report bugs consistently

The vast majority of error messages in Git's source code which report a
bug use the convention to prefix the message with "BUG:".

As part of cleaning up merge-recursive to stop die()ing except in case of
detected bugs, let's just make the remainder of the bug reports consistent
with the de facto rule.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2016-07-26 18:05:50 +02:00
committed by Junio C Hamano
parent 3be18b47e4
commit ef1177d18e
9 changed files with 21 additions and 21 deletions

View File

@ -268,7 +268,7 @@ struct tree *write_tree_from_memory(struct merge_options *o)
fprintf(stderr, "BUG: %d %.*s\n", ce_stage(ce),
(int)ce_namelen(ce), ce->name);
}
die("Bug in merge-recursive.c");
die("BUG: unmerged index entries in merge-recursive.c");
}
if (!active_cache_tree)
@ -966,9 +966,8 @@ static struct merge_file_info merge_file_1(struct merge_options *o,
if (!oid_eq(&a->oid, &b->oid))
result.clean = 0;
} else {
die(_("unsupported object type in the tree"));
}
} else
die(_("BUG: unsupported object type in the tree"));
}
return result;
@ -1354,7 +1353,7 @@ static int process_renames(struct merge_options *o,
const char *ren2_dst = ren2->pair->two->path;
enum rename_type rename_type;
if (strcmp(ren1_src, ren2_src) != 0)
die("ren1_src != ren2_src");
die("BUG: ren1_src != ren2_src");
ren2->dst_entry->processed = 1;
ren2->processed = 1;
if (strcmp(ren1_dst, ren2_dst) != 0) {
@ -1388,7 +1387,7 @@ static int process_renames(struct merge_options *o,
ren2 = lookup->util;
ren2_dst = ren2->pair->two->path;
if (strcmp(ren1_dst, ren2_dst) != 0)
die("ren1_dst != ren2_dst");
die("BUG: ren1_dst != ren2_dst");
clean_merge = 0;
ren2->processed = 1;
@ -1812,7 +1811,7 @@ static int process_entry(struct merge_options *o,
*/
remove_file(o, 1, path, !a_mode);
} else
die(_("Fatal merge failure, shouldn't happen."));
die(_("BUG: fatal merge failure, shouldn't happen."));
return clean_merge;
}
@ -1870,7 +1869,7 @@ int merge_trees(struct merge_options *o,
for (i = 0; i < entries->nr; i++) {
struct stage_data *e = entries->items[i].util;
if (!e->processed)
die(_("Unprocessed path??? %s"),
die(_("BUG: unprocessed path??? %s"),
entries->items[i].string);
}