]> git.ipfire.org Git - thirdparty/git.git/commit - name-hash.c
name-hash: add index_dir_find()
authorJeff Hostetler <jeffhostetler@github.com>
Mon, 26 Feb 2024 21:39:12 +0000 (21:39 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Feb 2024 23:34:01 +0000 (15:34 -0800)
commitb3165523394a3ad4ede8872b984bbc644b056cdc
treea22b99071b42ec2c4a6c2fadb8d7ecf5bee1be75
parentedae91a4cf221d44c8c891d5519b26fce17d56bb
name-hash: add index_dir_find()

index_dir_exists() returns a boolean to indicate if there is a
case-insensitive match in the directory name-hash, but does not
provide the caller with the exact spelling of that match.

Create index_dir_find() to do the case-insensitive search *and*
optionally return the spelling of the matched directory prefix in a
provided strbuf.

To avoid code duplication, convert index_dir_exists() to be a trivial
wrapper around the new index_dir_find().

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
name-hash.c
name-hash.h