aboutsummaryrefslogtreecommitdiff
path: root/url.c
diff options
context:
space:
mode:
authorAdrian Ratiu <adrian.ratiu@collabora.com>2026-01-12 20:46:28 +0200
committerJunio C Hamano <gitster@pobox.com>2026-01-12 11:56:56 -0800
commit226694bdf4aaecd18f6cd4df12656cc61b213d16 (patch)
tree07e4631cf6f751e9849a4668a51ed4735d6a7d0e /url.c
parente14349d58eeae0eac23bf7f740d22f51fc90a49d (diff)
downloadgit-226694bdf4aaecd18f6cd4df12656cc61b213d16.tar.xz
builtin/credential-store: move is_rfc3986_unreserved to url.[ch]
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 as a public function exposed via url.h, instead of the old helper path (strbuf), which has nothing to do with 3986 encoding/decoding anymore. This function will be used in subsequent commits which do the encoding. Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'url.c')
-rw-r--r--url.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/url.c b/url.c
index 282b12495a..adc289229c 100644
--- a/url.c
+++ b/url.c
@@ -3,6 +3,12 @@
#include "strbuf.h"
#include "url.h"
+int is_rfc3986_unreserved(char ch)
+{
+ return isalnum(ch) ||
+ ch == '-' || ch == '_' || ch == '.' || ch == '~';
+}
+
int is_urlschemechar(int first_flag, int ch)
{
/*