diff options
Diffstat (limited to 'src/iterator.h')
-rw-r--r-- | src/iterator.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/iterator.h b/src/iterator.h index dcedbd530..ba9c1e486 100644 --- a/src/iterator.h +++ b/src/iterator.h @@ -258,12 +258,23 @@ extern int git_iterator_current_workdir_path( /* Return index pointer if index iterator, else NULL */ extern git_index *git_iterator_get_index(git_iterator *iter); -/* Special type of advance that can be called when looking at a tree in - * the working directory that leaves the iterator on the next item after - * the tree, but also scans the tree contents looking for any items that - * are not ignored. +typedef enum { + GIT_ITERATOR_STATUS_NORMAL = 0, + GIT_ITERATOR_STATUS_IGNORED = 1, + GIT_ITERATOR_STATUS_EMPTY = 2 +} git_iterator_status_t; + +/* Advance over a directory and check if it contains no files or just + * ignored files. + * + * In a tree or the index, all directories will contain files, but in the + * working directory it is possible to have an empty directory tree or a + * tree that only contains ignored files. Many Git operations treat these + * cases specially. This advances over a directory (presumably an + * untracked directory) but checks during the scan if there are any files + * and any non-ignored files. */ -extern int git_iterator_advance_over_and_check_ignored( - const git_index_entry **entry, bool *ignored, git_iterator *iter); +extern int git_iterator_advance_over_with_status( + const git_index_entry **entry, git_iterator_status_t *status, git_iterator *iter); #endif |