From a78537a0f26615b69b680845cfbb765cc665c808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 7 Dec 2021 12:05:53 +0100 Subject: pathspec: use BUG(...) not die("BUG:%s:%d....", , ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change code that was added in 8f4f8f4579f (guard against new pathspec magic in pathspec matching code, 2013-07-14) to use the BUG() macro instead of emitting a "fatal" message with the "__FILE__"-name and "__LINE__"-numbers. The original code predated the existence of the BUG() function, which was added in d8193743e08 (usage.c: add BUG() function, 2017-05-12). Signed-off-by: Junio C Hamano Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- pathspec.h | 3 +-- tree-diff.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pathspec.h b/pathspec.h index 2341dc9901..402ebb8080 100644 --- a/pathspec.h +++ b/pathspec.h @@ -58,8 +58,7 @@ struct pathspec { #define GUARD_PATHSPEC(ps, mask) \ do { \ if ((ps)->magic & ~(mask)) \ - die("BUG:%s:%d: unsupported magic %x", \ - __FILE__, __LINE__, (ps)->magic & ~(mask)); \ + BUG("unsupported magic %x", (ps)->magic & ~(mask)); \ } while (0) /* parse_pathspec flags */ diff --git a/tree-diff.c b/tree-diff.c index 437c98a70e..69031d7cba 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -603,8 +603,7 @@ static void try_to_follow_renames(const struct object_id *old_oid, * about dry-run mode and returns wildcard info. */ if (opt->pathspec.has_wildcard) - die("BUG:%s:%d: wildcards are not supported", - __FILE__, __LINE__); + BUG("wildcards are not supported"); #endif /* Remove the file creation entry from the diff queue, and remember it */ -- cgit v1.2.3