]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pathspec: use BUG(...) not die("BUG:%s:%d....", <file>, <line>)
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 7 Dec 2021 11:05:53 +0000 (12:05 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Dec 2021 20:31:17 +0000 (12:31 -0800)
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 <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pathspec.h
tree-diff.c

index 2341dc990102b0ffcf63636855cb6df3a864a603..402ebb808081e386da46786fe1d5a1521e3cc4ac 100644 (file)
@@ -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 */
index 437c98a70e47ebc89d258e281f16207b9dfa990d..69031d7cbae6a88c1fca3242e974d9cd435a4c78 100644 (file)
@@ -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 */