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-12-19 03:19:24 +0400
committerRussell Belfer <rb@github.com>2013-01-05 03:47:42 +0400
commit5cf9875a4f6ee6fa26f5617aca8433dd49c72751 (patch)
tree95f749b7d3e7eeb546148d21458ebfa33248c3dc /src/iterator.c
parent7e5c8a5b41ca660def7de23fd32b942878a6ee24 (diff)
Add index updating to checkout
Make checkout update entries in the index for all files that are updated and/or removed, unless flag GIT_CHECKOUT_DONT_UPDATE_INDEX is given. To do this, iterators were extended to allow a little more introspection into the index being iterated over, etc.
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/iterator.c b/src/iterator.c
index 28fccce0e..b15453400 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -988,6 +988,33 @@ fail:
return -1;
}
+git_index *git_iterator_index_get_index(git_iterator *iter)
+{
+ if (iter->type == GIT_ITERATOR_SPOOLANDSORT)
+ iter = ((spoolandsort_iterator *)iter)->wrapped;
+
+ if (iter->type == GIT_ITERATOR_INDEX)
+ return ((index_iterator *)iter)->index;
+
+ return NULL;
+}
+
+git_iterator_type_t git_iterator_inner_type(git_iterator *iter)
+{
+ if (iter->type == GIT_ITERATOR_SPOOLANDSORT)
+ iter = ((spoolandsort_iterator *)iter)->wrapped;
+
+ return iter->type;
+}
+
+git_iterator *git_iterator_spoolandsort_inner_iterator(git_iterator *iter)
+{
+ if (iter->type == GIT_ITERATOR_SPOOLANDSORT)
+ return ((spoolandsort_iterator *)iter)->wrapped;
+
+ return NULL;
+}
+
int git_iterator_current_tree_entry(
git_iterator *iter, const git_tree_entry **tree_entry)
{