Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-14 02:02:59 +0400
committerRussell Belfer <rb@github.com>2012-11-15 10:55:40 +0400
commitbad68c0a998116685ad75cab84210004dd2c5be1 (patch)
treed8b6db9be06ea1fcc150b5a7d2ba4cd635a174aa /src/iterator.h
parent5735bf5e6ab4da347b601d4b85c09c5c701dc002 (diff)
Add iterator for git_index object
The index iterator could previously only be created from a repo object, but this allows creating an iterator from a `git_index` object instead (while keeping, though renaming, the old function).
Diffstat (limited to 'src/iterator.h')
-rw-r--r--src/iterator.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/iterator.h b/src/iterator.h
index d7df50137..77ead76cc 100644
--- a/src/iterator.h
+++ b/src/iterator.h
@@ -52,13 +52,23 @@ GIT_INLINE(int) git_iterator_for_tree(
}
extern int git_iterator_for_index_range(
- git_iterator **iter, git_repository *repo,
+ git_iterator **iter, git_index *index,
const char *start, const char *end);
GIT_INLINE(int) git_iterator_for_index(
+ git_iterator **iter, git_index *index)
+{
+ return git_iterator_for_index_range(iter, index, NULL, NULL);
+}
+
+extern int git_iterator_for_repo_index_range(
+ git_iterator **iter, git_repository *repo,
+ const char *start, const char *end);
+
+GIT_INLINE(int) git_iterator_for_repo_index(
git_iterator **iter, git_repository *repo)
{
- return git_iterator_for_index_range(iter, repo, NULL, NULL);
+ return git_iterator_for_repo_index_range(iter, repo, NULL, NULL);
}
extern int git_iterator_for_workdir_range(