]> git.proxmox.com Git - libgit2.git/blob - src/ignore.h
Merge pull request #968 from arrbee/diff-support-typechange
[libgit2.git] / src / ignore.h
1 /*
2 * Copyright (C) 2009-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_ignore_h__
8 #define INCLUDE_ignore_h__
9
10 #include "repository.h"
11 #include "vector.h"
12
13 /* The git_ignores structure maintains three sets of ignores:
14 * - internal ignores
15 * - per directory ignores
16 * - global ignores (at lower priority than the others)
17 * As you traverse from one directory to another, you can push and pop
18 * directories onto git_ignores list efficiently.
19 */
20 typedef struct {
21 git_repository *repo;
22 git_buf dir;
23 git_attr_file *ign_internal;
24 git_vector ign_path;
25 git_vector ign_global;
26 unsigned int ignore_case:1;
27 } git_ignores;
28
29 extern int git_ignore__for_path(git_repository *repo, const char *path, git_ignores *ign);
30
31 extern int git_ignore__push_dir(git_ignores *ign, const char *dir);
32
33 extern int git_ignore__pop_dir(git_ignores *ign);
34
35 extern void git_ignore__free(git_ignores *ign);
36
37 extern int git_ignore__lookup(git_ignores *ign, const char *path, int *ignored);
38
39 #endif