]> git.ipfire.org Git - thirdparty/git.git/commit
url: return URL_SCHEME_UNKNOWN instead of dying
authorMatheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Sat, 2 May 2026 05:28:38 +0000 (05:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 May 2026 00:48:27 +0000 (09:48 +0900)
commit46d6fb752e7d8550a3511eb370536d216ddb5b8f
treebd1255a5b5e81613e022f36ff230a06520dffc2a
parentd48e36a8a23d931e869fbb3156fc95a5732cb061
url: return URL_SCHEME_UNKNOWN instead of dying

Enumerate a URL_SCHEME_UNKNOWN result with value 0.
Have url_get_scheme() return it for unrecognized
schemes instead of calling die() itself.
Move the die() call to parse_connect_url()
where url_get_scheme() is used.

This lets url_get_scheme() be used from contexts
that need to identify a URL's scheme without aborting
the program. For example, a future plumbing command
that validates URLs.

No external behavior change. parse_connect_url() still dies
with the same translated message for unrecognized schemes.

Signed-off-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c
url.c
url.h