summaryrefslogtreecommitdiff
path: root/tests/pack
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-12-01 09:37:40 +0100
committerPatrick Steinhardt <ps@pks.im>2019-02-15 13:16:48 +0100
commit18cf56989af8d8bdf6f9e736b65b1f91ef624177 (patch)
tree1d128b878b8df569e7507bfcd60e174cfce7f16c /tests/pack
parentc50a8ac2c734e4301223e39e4ddce98e6c368294 (diff)
downloadlibgit2-18cf56989af8d8bdf6f9e736b65b1f91ef624177.tar.gz
maps: provide high-level iteration interface
Currently, our headers need to leak some implementation details of maps due to their direct use of indices in the implementation of their foreach macros. This makes it impossible to completely hide the map structures away, and also makes it impossible to include the khash implementation header in the C files of the respective map only. This is now being fixed by providing a high-level iteration interface `map_iterate`, which takes as inputs the map that shall be iterated over, an iterator as well as the locations where keys and values shall be put into. For simplicity's sake, the iterator is a simple `size_t` that shall initialized to `0` on the first call. All existing foreach macros are then adjusted to make use of this new function.
Diffstat (limited to 'tests/pack')
-rw-r--r--tests/pack/sharing.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/pack/sharing.c b/tests/pack/sharing.c
index ec18006c4..eaf7686b7 100644
--- a/tests/pack/sharing.c
+++ b/tests/pack/sharing.c
@@ -24,7 +24,7 @@ void test_pack_sharing__open_two_repos(void)
cl_git_pass(git_object_lookup(&obj2, repo2, &id, GIT_OBJECT_ANY));
pos = 0;
- while ((error = git_strmap_next(&data, &pos, git__pack_cache)) == 0) {
+ while ((error = git_strmap_iterate(&data, git__pack_cache, &pos, NULL)) == 0) {
struct git_pack_file *pack = (struct git_pack_file *) data;
cl_assert_equal_i(2, pack->refcount.val);