]> git.ipfire.org Git - thirdparty/git.git/commit
path: add a function to check for path suffix
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 25 Aug 2019 23:33:39 +0000 (23:33 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Aug 2019 17:36:13 +0000 (10:36 -0700)
commitce17feb1b3ecfb0344af9b9111a4b4d313d51d7a
tree9b5887ed3d27021961e5019c6cf237bf0e757839
parent75b2f01a0f642b39b0f29b6218515df9b5eb798e
path: add a function to check for path suffix

We have a function to strip the path suffix from a commit, but we don't
have one to check for a path suffix. For a plain filename, we can use
basename, but that requires an allocation, since POSIX allows it to
modify its argument. Refactor strip_path_suffix into a helper function
and a new function, ends_with_path_components, to meet this need.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
path.c
path.h