summaryrefslogtreecommitdiff
path: root/src/iterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/iterator.h')
-rw-r--r--src/iterator.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/iterator.h b/src/iterator.h
index 751e139d0..ba9c1e486 100644
--- a/src/iterator.h
+++ b/src/iterator.h
@@ -258,4 +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);
+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_with_status(
+ const git_index_entry **entry, git_iterator_status_t *status, git_iterator *iter);
+
#endif