diff options
author | Russell Belfer <rb@github.com> | 2013-06-19 15:22:48 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-06-19 15:22:48 -0700 |
commit | 85b8b18b6a07b74dd2631c3a647ca758660bf298 (patch) | |
tree | 537c57716d28e82cf062e0feac159fd817ac2a7d /src/ignore.h | |
parent | e91f9a8f28ca58c5ff0450749a57d233a5512f2d (diff) | |
download | libgit2-85b8b18b6a07b74dd2631c3a647ca758660bf298.tar.gz |
Add fn to check pathspec for ignored files
Command line Git sometimes generates an error message if given a
pathspec that contains an exact match to an ignored file (provided
--force isn't also given). This adds an internal function that
makes it easy to check it that has happened. Right now, I'm not
creating a public API for this because that would get a little
more complicated with a need for callbacks for all invalid paths.
Diffstat (limited to 'src/ignore.h')
-rw-r--r-- | src/ignore.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ignore.h b/src/ignore.h index e00e4a8c8..cc114b001 100644 --- a/src/ignore.h +++ b/src/ignore.h @@ -41,4 +41,13 @@ extern void git_ignore__free(git_ignores *ign); extern int git_ignore__lookup(git_ignores *ign, const char *path, int *ignored); +/* command line Git sometimes generates an error message if given a + * pathspec that contains an exact match to an ignored file (provided + * --force isn't also given). This makes it easy to check it that has + * happened. Returns GIT_EINVALIDSPEC if the pathspec contains ignored + * exact matches (that are not already present in the index). + */ +extern int git_ignore__check_pathspec_for_exact_ignores( + git_repository *repo, git_vector *pathspec, bool no_fnmatch); + #endif |