From acb00e4eae66bfed84046bccb60bf59707fe9626 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Mon, 19 Sep 2022 10:39:58 -0400 Subject: repo: understand the `objectformat` extension Teach the repository about the `objectformat` extension, supporting `sha1` always and `sha256` when the experimental sha256 support is active. --- tests/libgit2/core/opts.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tests/libgit2/core') diff --git a/tests/libgit2/core/opts.c b/tests/libgit2/core/opts.c index e8f65d510..486ff58c6 100644 --- a/tests/libgit2/core/opts.c +++ b/tests/libgit2/core/opts.c @@ -34,8 +34,9 @@ void test_core_opts__extensions_query(void) cl_git_pass(git_libgit2_opts(GIT_OPT_GET_EXTENSIONS, &out)); - cl_assert_equal_sz(out.count, 1); + cl_assert_equal_sz(out.count, 2); cl_assert_equal_s("noop", out.strings[0]); + cl_assert_equal_s("objectformat", out.strings[1]); git_strarray_dispose(&out); } @@ -48,9 +49,10 @@ void test_core_opts__extensions_add(void) cl_git_pass(git_libgit2_opts(GIT_OPT_SET_EXTENSIONS, in, ARRAY_SIZE(in))); cl_git_pass(git_libgit2_opts(GIT_OPT_GET_EXTENSIONS, &out)); - cl_assert_equal_sz(out.count, 2); + cl_assert_equal_sz(out.count, 3); cl_assert_equal_s("noop", out.strings[0]); - cl_assert_equal_s("foo", out.strings[1]); + cl_assert_equal_s("objectformat", out.strings[1]); + cl_assert_equal_s("foo", out.strings[2]); git_strarray_dispose(&out); } @@ -63,9 +65,10 @@ void test_core_opts__extensions_remove(void) cl_git_pass(git_libgit2_opts(GIT_OPT_SET_EXTENSIONS, in, ARRAY_SIZE(in))); cl_git_pass(git_libgit2_opts(GIT_OPT_GET_EXTENSIONS, &out)); - cl_assert_equal_sz(out.count, 2); - cl_assert_equal_s("bar", out.strings[0]); - cl_assert_equal_s("baz", out.strings[1]); + cl_assert_equal_sz(out.count, 3); + cl_assert_equal_s("objectformat", out.strings[0]); + cl_assert_equal_s("bar", out.strings[1]); + cl_assert_equal_s("baz", out.strings[2]); git_strarray_dispose(&out); } -- cgit v1.2.1