1 #include "clar_libgit2.h"
2 #include "thread_helpers.h"
5 static git_repository
*_repo
;
7 void test_threads_iterator__cleanup(void)
9 cl_git_sandbox_cleanup();
12 static void *run_workdir_iterator(void *arg
)
17 git_iterator_options iter_opts
= GIT_ITERATOR_OPTIONS_INIT
;
18 const git_index_entry
*entry
= NULL
;
20 iter_opts
.flags
= GIT_ITERATOR_DONT_AUTOEXPAND
;
22 cl_git_pass(git_repository_open(&repo
, git_repository_path(_repo
)));
23 cl_git_pass(git_iterator_for_workdir(
24 &iter
, repo
, NULL
, NULL
, &iter_opts
));
27 if (entry
&& entry
->mode
== GIT_FILEMODE_TREE
) {
28 error
= git_iterator_advance_into(&entry
, iter
);
30 if (error
== GIT_ENOTFOUND
)
31 error
= git_iterator_advance(&entry
, iter
);
33 error
= git_iterator_advance(&entry
, iter
);
37 (void)git_iterator_current_is_ignored(iter
);
40 cl_assert_equal_i(GIT_ITEROVER
, error
);
42 git_iterator_free(iter
);
43 git_repository_free(repo
);
49 void test_threads_iterator__workdir(void)
51 _repo
= cl_git_sandbox_init("status");
54 1, 20, run_workdir_iterator
, NULL
, NULL
);