diff options
author | Russell Belfer <rb@github.com> | 2012-10-15 12:48:43 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-10-15 12:54:46 -0700 |
commit | 52032ae53689ac37350f6af3bf1834122e4b3cf0 (patch) | |
tree | d9d98e14fa8e2a5d5d024dbd623bf9beb42e1330 /include/git2/status.h | |
parent | d5a51910678f8aea2b7efe077efc678141762dfc (diff) | |
download | libgit2-52032ae53689ac37350f6af3bf1834122e4b3cf0.tar.gz |
Fix single-file ignore checks
To answer if a single given file should be ignored, the path to
that file has to be processed progressively checking that there
are no intermediate ignored directories in getting to the file
in question. This enables that, fixing the broken old behavior,
and adds tests to exercise various ignore situations.
Diffstat (limited to 'include/git2/status.h')
-rw-r--r-- | include/git2/status.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/git2/status.h b/include/git2/status.h index cc94d7680..0dd98596e 100644 --- a/include/git2/status.h +++ b/include/git2/status.h @@ -146,10 +146,12 @@ GIT_EXTERN(int) git_status_file( /** * Test if the ignore rules apply to a given file. * - * This function simply checks the ignore rules to see if they would apply - * to the given file. Unlike git_status_file(), this indicates if the file - * would be ignored regardless of whether the file is already in the index - * or in the repository. + * This function checks the ignore rules to see if they would apply to the + * given file. This indicates if the file would be ignored regardless of + * whether the file is already in the index or commited to the repository. + * + * One way to think of this is if you were to do "git add ." on the + * directory containing the file, would it be added or not? * * @param ignored boolean returning 0 if the file is not ignored, 1 if it is * @param repo a repository object |