]> git.proxmox.com Git - libgit2.git/blob - src/pathspec.h
Merge pull request #1068 from carlosmn/config-empty-value
[libgit2.git] / src / pathspec.h
1 /*
2 * Copyright (C) 2011-2012 the libgit2 contributors
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_pathspec_h__
8 #define INCLUDE_pathspec_h__
9
10 #include "common.h"
11 #include "buffer.h"
12 #include "vector.h"
13 #include "pool.h"
14
15 /* what is the common non-wildcard prefix for all items in the pathspec */
16 extern char *git_pathspec_prefix(const git_strarray *pathspec);
17
18 /* is there anything in the spec that needs to be filtered on */
19 extern bool git_pathspec_is_interesting(const git_strarray *pathspec);
20
21 /* build a vector of fnmatch patterns to evaluate efficiently */
22 extern int git_pathspec_init(
23 git_vector *vspec, const git_strarray *strspec, git_pool *strpool);
24
25 /* free data from the pathspec vector */
26 extern void git_pathspec_free(git_vector *vspec);
27
28 /* match a path against the vectorized pathspec */
29 extern bool git_pathspec_match_path(
30 git_vector *vspec, const char *path, bool disable_fnmatch, bool casefold);
31
32 #endif