aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorAdrian Ratiu <adrian.ratiu@collabora.com>2025-11-07 17:05:45 +0200
committerJunio C Hamano <gitster@pobox.com>2025-11-07 09:01:11 -0800
commit0c1df3fb80a490dc4e8ffd7ed856bf32ae348331 (patch)
tree380e087aa7cc4ae6cb9ca787d2852e3949ed1be8 /builtin
parentsubmodule--helper: use submodule_name_to_gitdir in add_submodule (diff)
downloadgit-0c1df3fb80a490dc4e8ffd7ed856bf32ae348331.tar.gz
git-0c1df3fb80a490dc4e8ffd7ed856bf32ae348331.zip
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 by submodule.c in the next commit. Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/credential-store.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/builtin/credential-store.c b/builtin/credential-store.c
index b74e06cc93..bc1453c6b2 100644
--- a/builtin/credential-store.c
+++ b/builtin/credential-store.c
@@ -7,6 +7,7 @@
#include "path.h"
#include "string-list.h"
#include "parse-options.h"
+#include "url.h"
#include "write-or-die.h"
static struct lock_file credential_lock;
@@ -76,12 +77,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))