From cbadaccdf6b8a87f962a9230b977cd6b28d7bada Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 14:14:32 -0700 Subject: Build a literal pathspec in one place Git's pathspec item holds a const string now, so a path needs no writable copy to be matched. --- source/shared.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/shared.h') diff --git a/source/shared.h b/source/shared.h index 09e9296..2633a24 100644 --- a/source/shared.h +++ b/source/shared.h @@ -72,6 +72,12 @@ extern int cgit_diff_files(const struct object_id *old_oid, const struct object_ */ extern int cgit_blob_too_large(size_t size); +/* + * Point ps at item alone, set to match path literally rather than as a glob, + * or at no item when path is NULL, which leaves every path matching. + */ +extern void cgit_literal_pathspec(struct pathspec *ps, struct pathspec_item *item, const char *path); + /* * Limit a diff to the paths below prefix, which is taken literally. */ -- cgit