strbuf: bring back is_rfc3986_unreserved
is_rfc3986_unreserved() was moved to credential-store.c and was made
static by f89854362c
(credential-store: move related functions to
credential-store file, 2023-06-06) under a correct assumption, at the
time, that it was the only place using it.
However now we need it to apply URL-encoding to submodule names when
constructing gitdir paths, to avoid conflicts, so bring it back.
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
seen
parent
3f5aab3d70
commit
fb3b2e627f
|
@ -76,12 +76,6 @@ static void rewrite_credential_file(const char *fn, struct credential *c,
|
|||
die_errno("unable to write credential store");
|
||||
}
|
||||
|
||||
static int is_rfc3986_unreserved(char ch)
|
||||
{
|
||||
return isalnum(ch) ||
|
||||
ch == '-' || ch == '_' || ch == '.' || ch == '~';
|
||||
}
|
||||
|
||||
static int is_rfc3986_reserved_or_unreserved(char ch)
|
||||
{
|
||||
if (is_rfc3986_unreserved(ch))
|
||||
|
|
6
strbuf.c
6
strbuf.c
|
@ -817,6 +817,12 @@ void strbuf_addstr_xml_quoted(struct strbuf *buf, const char *s)
|
|||
}
|
||||
}
|
||||
|
||||
int is_rfc3986_unreserved(char ch)
|
||||
{
|
||||
return isalnum(ch) ||
|
||||
ch == '-' || ch == '_' || ch == '.' || ch == '~';
|
||||
}
|
||||
|
||||
static void strbuf_add_urlencode(struct strbuf *sb, const char *s, size_t len,
|
||||
char_predicate allow_unencoded_fn)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue