string.c
4.74 KB
-
util: introduce `git__prefixncmp` and consolidate implementations · a8db6c92
Introduce `git_prefixncmp` that will search up to the first `n` characters of a string to see if it is prefixed by another string. This is useful for examining if a non-null terminated character array is prefixed by a particular substring. Consolidate the various implementations of `git__prefixcmp` around a single core implementation and add some test cases to validate its behavior. (cherry picked from commit 86219f40)
Edward Thomson committed