summaryrefslogtreecommitdiffstats
path: root/submodule-config.h
diff options
context:
space:
mode:
authorVictoria Dye <vdye@github.com>2024-01-18 02:55:15 +0100
committerJunio C Hamano <gitster@pobox.com>2024-01-18 19:12:48 +0100
commit13320ff610b4083341175c4f8e636a1bc52145f5 (patch)
tree13c29bcf8c127211ee46efa596c72e946f607b19 /submodule-config.h
parentGit 2.43 (diff)
downloadgit-13320ff610b4083341175c4f8e636a1bc52145f5.tar.xz
git-13320ff610b4083341175c4f8e636a1bc52145f5.zip
submodule-config.h: move check_submodule_url
Move 'check_submodule_url' out of 'fsck.c' and into 'submodule-config.h' as a public method, similar to 'check_submodule_name'. With the function now accessible outside of 'fsck', it can be used in a later commit to extend 'test-tool submodule' to check the validity of submodule URLs as it does with names in the 'check-name' subcommand. Other than its location, no changes are made to 'check_submodule_url' in this patch. Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule-config.h')
-rw-r--r--submodule-config.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/submodule-config.h b/submodule-config.h
index 2a37689cc2..b5785686f5 100644
--- a/submodule-config.h
+++ b/submodule-config.h
@@ -91,6 +91,9 @@ int config_set_in_gitmodules_file_gently(const char *key, const char *value);
*/
int check_submodule_name(const char *name);
+/* Returns 0 if the URL valid per RFC3986 and -1 otherwise. */
+int check_submodule_url(const char *url);
+
/*
* Note: these helper functions exist solely to maintain backward
* compatibility with 'fetch' and 'update_clone' storing configuration in