ignore.h 1.07 KB
Newer Older
1
/*
schu committed
2
 * Copyright (C) 2009-2012 the libgit2 contributors
3 4 5 6 7 8 9 10 11 12
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_ignore_h__
#define INCLUDE_ignore_h__

#include "repository.h"
#include "vector.h"

13 14 15 16 17 18 19
/* The git_ignores structure maintains three sets of ignores:
 * - internal ignores
 * - per directory ignores
 * - global ignores (at lower priority than the others)
 * As you traverse from one directory to another, you can push and pop
 * directories onto git_ignores list efficiently.
 */
20 21
typedef struct {
	git_repository *repo;
22 23 24 25
	git_buf dir;
	git_attr_file *ign_internal;
	git_vector ign_path;
	git_vector ign_global;
26 27
} git_ignores;

28
extern int git_ignore__for_path(git_repository *repo, const char *path, git_ignores *ign);
29 30

extern int git_ignore__push_dir(git_ignores *ign, const char *dir);
31

32 33 34
extern int git_ignore__pop_dir(git_ignores *ign);

extern void git_ignore__free(git_ignores *ign);
35

36
extern int git_ignore__lookup(git_ignores *ign, const char *path, int *ignored);
37 38

#endif