]> git.ipfire.org Git - thirdparty/git.git/commitdiff
parse-options.c: turn some die() to BUG()
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 10 Nov 2018 05:16:12 +0000 (06:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Nov 2018 05:47:09 +0000 (14:47 +0900)
These two strings are clearly not for the user to see. Reduce the
violence in one string while at there.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c

index 0bf817193d02fe3741b589719adebc5c57547009..3f5f985c1eb933fb3fff4269ab855c258cda306f 100644 (file)
@@ -197,7 +197,7 @@ static int get_value(struct parse_opt_ctx_t *p,
                return 0;
 
        default:
-               die("should not happen, someone must be hit on the forehead");
+               BUG("opt->type %d should not happen", opt->type);
        }
 }
 
@@ -424,7 +424,7 @@ void parse_options_start(struct parse_opt_ctx_t *ctx,
        ctx->flags = flags;
        if ((flags & PARSE_OPT_KEEP_UNKNOWN) &&
            (flags & PARSE_OPT_STOP_AT_NON_OPTION))
-               die("STOP_AT_NON_OPTION and KEEP_UNKNOWN don't go together");
+               BUG("STOP_AT_NON_OPTION and KEEP_UNKNOWN don't go together");
        parse_options_check(options);
 }