]>
Commit | Line | Data |
---|---|---|
df743c7d | 1 | /* |
359fc2d2 | 2 | * Copyright (C) the libgit2 contributors. All rights reserved. |
df743c7d RB |
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 | ||
b6c93aef RB |
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 | */ | |
adc9bdb3 RB |
20 | typedef struct { |
21 | git_repository *repo; | |
b6c93aef RB |
22 | git_buf dir; |
23 | git_attr_file *ign_internal; | |
24 | git_vector ign_path; | |
25 | git_vector ign_global; | |
ec40b7f9 | 26 | unsigned int ignore_case:1; |
adc9bdb3 RB |
27 | } git_ignores; |
28 | ||
f917481e | 29 | extern int git_ignore__for_path(git_repository *repo, const char *path, git_ignores *ign); |
b6c93aef RB |
30 | |
31 | extern int git_ignore__push_dir(git_ignores *ign, const char *dir); | |
f917481e | 32 | |
b6c93aef RB |
33 | extern int git_ignore__pop_dir(git_ignores *ign); |
34 | ||
35 | extern void git_ignore__free(git_ignores *ign); | |
f917481e | 36 | |
b6c93aef | 37 | extern int git_ignore__lookup(git_ignores *ign, const char *path, int *ignored); |
df743c7d RB |
38 | |
39 | #endif |