git/compat
Ævar Arnfjörð Bjarmason 9fd512c8d6 dir API: add a generalized path_match_flags() function
Add a path_match_flags() function and have the two sets of
starts_with_dot_{,dot_}slash() functions added in
63e95beb08 (submodule: port resolve_relative_url from shell to C,
2016-04-15) and a2b26ffb1a (fsck: convert gitmodules url to URL
passed to curl, 2020-04-18) be thin wrappers for it.

As the latter of those notes the fsck version was copied from the
initial builtin/submodule--helper.c version.

Since the code added in a2b26ffb1a was doing really doing the same as
win32_is_dir_sep() added in 1cadad6f65 (git clone <url>
C:\cygwin\home\USER\repo' is working (again), 2018-12-15) let's move
the latter to git-compat-util.h is a is_xplatform_dir_sep(). We can
then call either it or the platform-specific is_dir_sep() from this
new function.

Let's likewise change code in various other places that was hardcoding
checks for "'/' || '\\'" with the new is_xplatform_dir_sep(). As can
be seen in those callers some of them still concern themselves with
':' (Mac OS classic?), but let's leave the question of whether that
should be consolidated for some other time.

As we expect to make wider use of the "native" case in the future,
define and use two starts_with_dot_{,dot_}slash_native() convenience
wrappers. This makes the diff in builtin/submodule--helper.c much
smaller.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-16 15:02:09 -07:00
..
fsmonitor compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS 2022-03-25 16:04:16 -07:00
linux
…
nedmalloc
…
poll
…
regex
…
simple-ipc
…
stub
…
vcbuild
…
win32 dir API: add a generalized path_match_flags() function 2022-05-16 15:02:09 -07:00
.gitattributes
…
access.c
…
apple-common-crypto.h
…
basename.c
…
bswap.h
…
compiler.h
…
fileno.c
…
fopen.c
…
hstrerror.c
…
inet_ntop.c
…
inet_pton.c
…
memmem.c
…
mingw.c dir API: add a generalized path_match_flags() function 2022-05-16 15:02:09 -07:00
mingw.h Git 2.35.2 2022-04-11 16:44:45 -07:00
mkdir.c
…
mkdtemp.c
…
mmap.c
…
msvc.c
…
msvc.h
…
obstack.c
…
obstack.h
…
open.c
…
pread.c
…
precompose_utf8.c
…
precompose_utf8.h
…
qsort_s.c compat/qsort_s.c: avoid using potentially unaligned access 2022-01-07 14:20:58 -08:00
setenv.c
…
sha1-chunked.c
…
sha1-chunked.h
…
snprintf.c
…
stat.c
…
strcasestr.c
…
strdup.c
…
strlcpy.c
…
strtoimax.c
…
strtoumax.c
…
terminal.c terminal: restore settings on SIGTSTP 2022-03-16 12:24:44 -07:00
terminal.h terminal: don't assume stdin is /dev/tty 2022-03-16 12:24:43 -07:00
unsetenv.c
…
win32.h
…
win32mmap.c
…
winansi.c wrapper: make inclusion of Windows csprng header tightly scoped 2022-03-10 15:10:22 -08:00
zlib-uncompress2.c compat: auto-detect if zlib has uncompress2() 2022-01-26 09:05:55 -08:00