diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2015-07-28 11:41:27 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@microsoft.com> | 2015-08-28 18:39:47 -0400 |
| commit | ed1c64464a4e3126eef5d74d2c14c19133fa9cd8 (patch) | |
| tree | 8105397838d42450ae6bd38efe4479cf377eee7b /src/pathspec.c | |
| parent | 126932eb0b3986784915acb4fab8f4137d162651 (diff) | |
| download | libgit2-ed1c64464a4e3126eef5d74d2c14c19133fa9cd8.tar.gz | |
iterator: use an options struct instead of args
Diffstat (limited to 'src/pathspec.c')
| -rw-r--r-- | src/pathspec.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/pathspec.c b/src/pathspec.c index fab6f9a76..9304da705 100644 --- a/src/pathspec.c +++ b/src/pathspec.c @@ -524,16 +524,16 @@ int git_pathspec_match_workdir( uint32_t flags, git_pathspec *ps) { - int error = 0; git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; + int error = 0; assert(repo); - if (!(error = git_iterator_for_workdir( - &iter, repo, NULL, NULL, pathspec_match_iter_flags(flags), NULL, NULL))) { + iter_opts.flags = pathspec_match_iter_flags(flags); + if (!(error = git_iterator_for_workdir(&iter, repo, NULL, NULL, &iter_opts))) { error = pathspec_match_from_iterator(out, iter, flags, ps); - git_iterator_free(iter); } @@ -546,16 +546,16 @@ int git_pathspec_match_index( uint32_t flags, git_pathspec *ps) { - int error = 0; git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; + int error = 0; assert(index); - if (!(error = git_iterator_for_index( - &iter, index, pathspec_match_iter_flags(flags), NULL, NULL))) { + iter_opts.flags = pathspec_match_iter_flags(flags); + if (!(error = git_iterator_for_index(&iter, index, &iter_opts))) { error = pathspec_match_from_iterator(out, iter, flags, ps); - git_iterator_free(iter); } @@ -568,16 +568,16 @@ int git_pathspec_match_tree( uint32_t flags, git_pathspec *ps) { - int error = 0; git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; + int error = 0; assert(tree); - if (!(error = git_iterator_for_tree( - &iter, tree, pathspec_match_iter_flags(flags), NULL, NULL))) { + iter_opts.flags = pathspec_match_iter_flags(flags); + if (!(error = git_iterator_for_tree(&iter, tree, &iter_opts))) { error = pathspec_match_from_iterator(out, iter, flags, ps); - git_iterator_free(iter); } |
