]> git.ipfire.org Git - thirdparty/git.git/commitdiff
urlmatch: change 'allow_globs' arg to bool
authorChristian Couder <christian.couder@gmail.com>
Wed, 27 May 2026 14:08:14 +0000 (16:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 May 2026 20:20:15 +0000 (05:20 +0900)
The last argument of url_normalize_1() is `char allow_globs` but it is
used as a boolean, not as a char.

Let's convert it to a `bool`, and while at it convert the two calls to
url_normalize_1() so they pass 'true' or 'false' instead of '1' or '0'.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
urlmatch.c

index bf8cce6de9d8da048ff4fa737625daae177f7e32..b2d88a5289df6c6b1c3c5201942819dba76f3cd0 100644 (file)
@@ -112,7 +112,7 @@ static int match_host(const struct url_info *url_info,
        return (!url_len && !pat_len);
 }
 
-static char *url_normalize_1(const char *url, struct url_info *out_info, char allow_globs)
+static char *url_normalize_1(const char *url, struct url_info *out_info, bool allow_globs)
 {
        /*
         * Normalize NUL-terminated url using the following rules:
@@ -438,7 +438,7 @@ static char *url_normalize_1(const char *url, struct url_info *out_info, char al
 
 char *url_normalize(const char *url, struct url_info *out_info)
 {
-       return url_normalize_1(url, out_info, 0);
+       return url_normalize_1(url, out_info, false);
 }
 
 char *url_parse(const char *url_orig, struct url_info *out_info)
@@ -704,7 +704,7 @@ int urlmatch_config_entry(const char *var, const char *value,
                struct url_info norm_info;
 
                config_url = xmemdupz(key, dot - key);
-               norm_url = url_normalize_1(config_url, &norm_info, 1);
+               norm_url = url_normalize_1(config_url, &norm_info, true);
                if (norm_url)
                        retval = match_urls(url, &norm_info, &matched);
                else if (collect->fallback_match_fn)