summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-07-30 14:37:40 -0700
committerBen Straub <bstraub@github.com>2012-07-30 14:37:40 -0700
commitf1587b97a11e3a7283b32f5af46b7d057b8be4c5 (patch)
treeb028efd2921b06c5c94db33abea9b83d0ff6edfb /include
parente0681f6d07a9f6041e7450af4715a8df8552ad2e (diff)
downloadlibgit2-f1587b97a11e3a7283b32f5af46b7d057b8be4c5.tar.gz
Checkout: use git_index_read_tree_with_stats.
New variant of git_index_read_tree that fills in the 'total' field of a git_indexer_stats struct as it's walking the tree.
Diffstat (limited to 'include')
-rw-r--r--include/git2/index.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index f863a606..85f8cfc3 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -8,6 +8,7 @@
#define INCLUDE_git_index_h__
#include "common.h"
+#include "indexer.h"
#include "types.h"
#include "oid.h"
@@ -345,6 +346,20 @@ GIT_EXTERN(int) git_index_entry_stage(const git_index_entry *entry);
*/
GIT_EXTERN(int) git_index_read_tree(git_index *index, git_tree *tree);
+
+/**
+ * Read a tree into the index file with stats
+ *
+ * The current index contents will be replaced by the specified tree. The total
+ * node count is collected in stats.
+ *
+ * @param index an existing index object
+ * @param tree tree to read
+ * @param stats structure that receives the total node count
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_index_read_tree_with_stats(git_index *index, git_tree *tree, git_indexer_stats *stats);
+
/** @} */
GIT_END_DECL
#endif