Skip to content

Commit a78537a

Browse files
avargitster
authored andcommitted
pathspec: use BUG(...) not die("BUG:%s:%d....", <file>, <line>)
Change code that was added in 8f4f8f4 (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 d819374 (usage.c: add BUG() function, 2017-05-12). Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 46d699f commit a78537a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pathspec.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ struct pathspec {
5858
#define GUARD_PATHSPEC(ps, mask) \
5959
do { \
6060
if ((ps)->magic & ~(mask)) \
61-
die("BUG:%s:%d: unsupported magic %x", \
62-
__FILE__, __LINE__, (ps)->magic & ~(mask)); \
61+
BUG("unsupported magic %x", (ps)->magic & ~(mask)); \
6362
} while (0)
6463

6564
/* parse_pathspec flags */

tree-diff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,7 @@ static void try_to_follow_renames(const struct object_id *old_oid,
603603
* about dry-run mode and returns wildcard info.
604604
*/
605605
if (opt->pathspec.has_wildcard)
606-
die("BUG:%s:%d: wildcards are not supported",
607-
__FILE__, __LINE__);
606+
BUG("wildcards are not supported");
608607
#endif
609608

610609
/* Remove the file creation entry from the diff queue, and remember it */

0 commit comments

Comments
 (0)