summaryrefslogtreecommitdiff
path: root/src/checkout.c
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 /src/checkout.c
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 'src/checkout.c')
-rw-r--r--src/checkout.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 81389a77a..3eed002ec 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -191,8 +191,7 @@ int git_checkout_head(git_repository *repo, git_checkout_opts *opts, git_indexer
if (!git_repository_head_tree(&tree, repo)) {
git_index *idx;
if (!(retcode = git_repository_index(&idx, repo))) {
- /* TODO: Make git_index_read_tree fill in stats->total */
- if (!(retcode = git_index_read_tree(idx, tree))) {
+ if (!(retcode = git_index_read_tree_with_stats(idx, tree, stats))) {
retcode = git_tree_walk(tree, checkout_walker, GIT_TREEWALK_POST, &payload);
}
git_index_free(idx);