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
pathspec.c
10
pathspec.c
@ -198,7 +198,7 @@ static void parse_pathspec_attr_match(struct pathspec_item *item, const char *va
|
||||
}
|
||||
|
||||
if (item->attr_check->nr != item->attr_match_nr)
|
||||
die("BUG: should have same number of entries");
|
||||
BUG("should have same number of entries");
|
||||
|
||||
string_list_clear(&list, 0);
|
||||
}
|
||||
@ -422,7 +422,7 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
|
||||
|
||||
if (pathspec_prefix >= 0 &&
|
||||
(prefixlen || (prefix && *prefix)))
|
||||
die("BUG: 'prefix' magic is supposed to be used at worktree's root");
|
||||
BUG("'prefix' magic is supposed to be used at worktree's root");
|
||||
|
||||
if ((magic & PATHSPEC_LITERAL) && (magic & PATHSPEC_GLOB))
|
||||
die(_("%s: 'literal' and 'glob' are incompatible"), elt);
|
||||
@ -545,7 +545,7 @@ void parse_pathspec(struct pathspec *pathspec,
|
||||
|
||||
if ((flags & PATHSPEC_PREFER_CWD) &&
|
||||
(flags & PATHSPEC_PREFER_FULL))
|
||||
die("BUG: PATHSPEC_PREFER_CWD and PATHSPEC_PREFER_FULL are incompatible");
|
||||
BUG("PATHSPEC_PREFER_CWD and PATHSPEC_PREFER_FULL are incompatible");
|
||||
|
||||
/* No arguments with prefix -> prefix pathspec */
|
||||
if (!entry) {
|
||||
@ -553,7 +553,7 @@ void parse_pathspec(struct pathspec *pathspec,
|
||||
return;
|
||||
|
||||
if (!(flags & PATHSPEC_PREFER_CWD))
|
||||
die("BUG: PATHSPEC_PREFER_CWD requires arguments");
|
||||
BUG("PATHSPEC_PREFER_CWD requires arguments");
|
||||
|
||||
pathspec->items = item = xcalloc(1, sizeof(*item));
|
||||
item->match = xstrdup(prefix);
|
||||
@ -609,7 +609,7 @@ void parse_pathspec(struct pathspec *pathspec,
|
||||
|
||||
if (pathspec->magic & PATHSPEC_MAXDEPTH) {
|
||||
if (flags & PATHSPEC_KEEP_ORDER)
|
||||
die("BUG: PATHSPEC_MAXDEPTH_VALID and PATHSPEC_KEEP_ORDER are incompatible");
|
||||
BUG("PATHSPEC_MAXDEPTH_VALID and PATHSPEC_KEEP_ORDER are incompatible");
|
||||
QSORT(pathspec->items, pathspec->nr, pathspec_item_cmp);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user