summaryrefslogtreecommitdiff
path: root/tests/libgit2/pack/packbuilder.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-09-21 05:09:46 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2023-02-12 22:02:00 +0000
commitfe2ee3a018286b04cd0c64f84d437c7317c8f138 (patch)
tree196a29fc72ef0a27e0277b4d142cc93c28fa4cb7 /tests/libgit2/pack/packbuilder.c
parent6204499242101d0f93cd7e56e259c900828e41e1 (diff)
downloadlibgit2-fe2ee3a018286b04cd0c64f84d437c7317c8f138.tar.gz
object: lookup sha256 objects
This is much of the plumbing for the object database to support SHA256, and for objects to be able to parse SHA256 versions of themselves.
Diffstat (limited to 'tests/libgit2/pack/packbuilder.c')
-rw-r--r--tests/libgit2/pack/packbuilder.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/libgit2/pack/packbuilder.c b/tests/libgit2/pack/packbuilder.c
index 0889f46ed..ff3dc1f68 100644
--- a/tests/libgit2/pack/packbuilder.c
+++ b/tests/libgit2/pack/packbuilder.c
@@ -104,7 +104,12 @@ void test_pack_packbuilder__create_pack(void)
seed_packbuilder();
+#ifdef GIT_EXPERIMENTAL_SHA256
+ cl_git_pass(git_indexer_new(&_indexer, ".", GIT_OID_SHA1, NULL));
+#else
cl_git_pass(git_indexer_new(&_indexer, ".", 0, NULL, NULL));
+#endif
+
cl_git_pass(git_packbuilder_foreach(_packbuilder, feed_indexer, &stats));
cl_git_pass(git_indexer_commit(_indexer, &stats));
@@ -244,7 +249,13 @@ void test_pack_packbuilder__foreach(void)
git_indexer *idx;
seed_packbuilder();
+
+#ifdef GIT_EXPERIMENTAL_SHA256
+ cl_git_pass(git_indexer_new(&idx, ".", GIT_OID_SHA1, NULL));
+#else
cl_git_pass(git_indexer_new(&idx, ".", 0, NULL, NULL));
+#endif
+
cl_git_pass(git_packbuilder_foreach(_packbuilder, foreach_cb, idx));
cl_git_pass(git_indexer_commit(idx, &_stats));
git_indexer_free(idx);
@@ -262,7 +273,13 @@ void test_pack_packbuilder__foreach_with_cancel(void)
git_indexer *idx;
seed_packbuilder();
+
+#ifdef GIT_EXPERIMENTAL_SHA256
+ cl_git_pass(git_indexer_new(&idx, ".", GIT_OID_SHA1, NULL));
+#else
cl_git_pass(git_indexer_new(&idx, ".", 0, NULL, NULL));
+#endif
+
cl_git_fail_with(
git_packbuilder_foreach(_packbuilder, foreach_cancel_cb, idx), -1111);
git_indexer_free(idx);