diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-08-30 18:56:39 -0400 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2015-08-30 18:56:39 -0400 |
commit | 7b73739fddce91731bb53320ae6e43d7d7276169 (patch) | |
tree | 116f4fc45b60194ce1f40df1a15488e99d6773b3 /src/checkout.c | |
parent | 1af84271dd221343bc199207f3eb923781124928 (diff) | |
download | libgit2-7b73739fddce91731bb53320ae6e43d7d7276169.tar.gz |
checkout: use pathlist-based iterators
Diffstat (limited to 'src/checkout.c')
-rw-r--r-- | src/checkout.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c index 311040d59..de48c9e01 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -2652,6 +2652,7 @@ int git_checkout_tree( git_index *index; git_tree *tree = NULL; git_iterator *tree_i = NULL; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; if (!treeish && !repo) { giterr_set(GITERR_CHECKOUT, @@ -2687,7 +2688,12 @@ int git_checkout_tree( if ((error = git_repository_index(&index, repo)) < 0) return error; - if (!(error = git_iterator_for_tree(&tree_i, tree, NULL))) + if ((opts->checkout_strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH)) { + iter_opts.pathlist.count = opts->paths.count; + iter_opts.pathlist.strings = opts->paths.strings; + } + + if (!(error = git_iterator_for_tree(&tree_i, tree, &iter_opts))) error = git_checkout_iterator(tree_i, index, opts); git_iterator_free(tree_i); |