git/t/unit-tests
Matheus Afonso Martins Moreira 18a8281712 urlmatch: define url_parse function
Define url_parse, a general parsing function that supports all Git URLs
including scp style URLs such as hostname:~user/repo.

It is adapted from the algorithm in connect.c's parse_connect_url
and reuses the shared enum url_scheme and url_get_scheme function
that previous commits made available in url.h. The new parser and
the connect path agree on scheme classification. url_parse has the
same interface as url_normalize and uses the same data structures.

Both functions accept the same URL forms with one deliberate
exception. Bare local paths such as "/abs/path", "./rel"
or "repo" are accepted by parse_connect_url as URL_SCHEME_LOCAL,
but rejected by url_parse because url_normalize requires a URL
with a scheme://host form. A consumer that wants to handle both
URLs and local paths needs to dispatch on url_is_local_not_ssh
before calling url_parse, just as the connect path does internally.

The duplication with parse_connect_url is intentional.
The two functions have different contracts:

  - parse_connect_url

    Calls die() on an unknown scheme
    and returns NUL-terminated host/path
    strings for the connect path

  - url_parse

    Returns NULL on failure while populating
    out_info->err, and exposes components
    as offset/length pairs into the normalized
    URL buffer, matching url_normalize.

Reconciling both is possible, but not in the scope
of the current patch set.

Signed-off-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-05-06 09:48:28 +09:00
..
clar Merge branch 'ps/clar-wo-path-max' 2026-03-24 12:31:32 -07:00
.gitignore
generate-clar-decls.sh
generate-clar-suites.sh
lib-oid.c
lib-oid.h
lib-reftable.c
lib-reftable.h
test-lib.c test-lib: print escape sequence names 2026-03-11 11:38:54 -07:00
test-lib.h
u-ctype.c
u-dir.c
u-example-decorate.c
u-hash.c
u-hashmap.c
u-list-objects-filter-options.c list-objects-filter-options: support 'auto' mode for --filter 2026-02-17 11:46:40 -08:00
u-mem-pool.c
u-oid-array.c
u-oidmap.c oidmap: make entry cleanup explicit in oidmap_clear 2026-03-05 11:16:18 -08:00
u-oidtree.c oidtree: extend iteration to allow for arbitrary return codes 2026-03-20 13:16:22 -07:00
u-prio-queue.c
u-reftable-basics.c
u-reftable-block.c
u-reftable-merged.c
u-reftable-pq.c
u-reftable-readwrite.c
u-reftable-record.c
u-reftable-stack.c
u-reftable-table.c
u-reftable-tree.c
u-strbuf.c
u-strcmp-offset.c
u-string-list.c string-list: add string_list_sort_u() that mimics "sort -u" 2026-01-29 09:32:50 -08:00
u-strvec.c
u-trailer.c
u-urlmatch-normalization.c urlmatch: define url_parse function 2026-05-06 09:48:28 +09:00
u-utf8-width.c
unit-test.c
unit-test.h