]> git.ipfire.org Git - thirdparty/git.git/commit
dir: move starts_with_dot(_dot)_slash to dir.h
authorJacob Keller <jacob.keller@gmail.com>
Mon, 23 Jun 2025 23:11:31 +0000 (16:11 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Jun 2025 23:38:56 +0000 (16:38 -0700)
commit059268fd056c4063eb913e6ec265bcdf85437b03
tree19f30abc9cd434b9c4c0809f049f715fe24009bd
parent2084f119b4d8252116493336f597d205cfa8f0b8
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>
builtin/submodule--helper.c
dir.h
submodule-config.c