aboutsummaryrefslogtreecommitdiffstats
path: root/submodule-config.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.keller@gmail.com>2025-06-23 16:11:31 -0700
committerJunio C Hamano <gitster@pobox.com>2025-06-23 16:38:56 -0700
commit059268fd056c4063eb913e6ec265bcdf85437b03 (patch)
tree19f30abc9cd434b9c4c0809f049f715fe24009bd /submodule-config.c
parentremote: fix tear down of struct remote (diff)
downloadgit-059268fd056c4063eb913e6ec265bcdf85437b03.tar.gz
git-059268fd056c4063eb913e6ec265bcdf85437b03.zip
dir: move starts_with_dot(_dot)_slash to dir.h
Both submodule--helper.c and submodule-config.c have an implementation of starts_with_dot_slash and starts_with_dot_dot_slash. The dir.h header has starts_with_dot(_dot)_slash_native, which sets PATH_MATCH_NATIVE. Move the helpers to dir.h as static inlines. I thought about renaming them to postfix with _platform but that felt too long and ugly. On the other hand it might be slightly confusing with _native. This simplifies a submodule refactor which wants to use the helpers earlier in the submodule--helper.c file. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule-config.c')
-rw-r--r--submodule-config.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/submodule-config.c b/submodule-config.c
index 8630e27947..d64438b2a1 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -235,18 +235,6 @@ in_component:
return 0;
}
-static int starts_with_dot_slash(const char *const path)
-{
- return path_match_flags(path, PATH_MATCH_STARTS_WITH_DOT_SLASH |
- PATH_MATCH_XPLATFORM);
-}
-
-static int starts_with_dot_dot_slash(const char *const path)
-{
- return path_match_flags(path, PATH_MATCH_STARTS_WITH_DOT_DOT_SLASH |
- PATH_MATCH_XPLATFORM);
-}
-
static int submodule_url_is_relative(const char *url)
{
return starts_with_dot_slash(url) || starts_with_dot_dot_slash(url);