summaryrefslogtreecommitdiff
path: root/tests/libgit2/grafts
diff options
context:
space:
mode:
authorYuang Li <yuangli88@hotmail.com>2022-09-06 16:01:52 +0100
committerYuang Li <yuangli88@hotmail.com>2022-09-06 16:01:52 +0100
commita9793ac643a0cd82b00970d0d6e0b67681ec3112 (patch)
tree6673f2e494d1710b82f99b7b49c52a1ab85d3669 /tests/libgit2/grafts
parent4f2f91a34f2e66a4511ebf0a650f379bd1c0e41f (diff)
downloadlibgit2-a9793ac643a0cd82b00970d0d6e0b67681ec3112.tar.gz
refactor grafts tests
Diffstat (limited to 'tests/libgit2/grafts')
-rw-r--r--tests/libgit2/grafts/basic.c10
-rw-r--r--tests/libgit2/grafts/parse.c4
-rw-r--r--tests/libgit2/grafts/shallow.c4
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/libgit2/grafts/basic.c b/tests/libgit2/grafts/basic.c
index 4be4a12bf..5ad437b19 100644
--- a/tests/libgit2/grafts/basic.c
+++ b/tests/libgit2/grafts/basic.c
@@ -27,10 +27,10 @@ void test_grafts_basic__graft_add(void)
cl_git_pass(git_grafts_new(&grafts));
cl_assert(oid1 = git_array_alloc(parents));
- cl_git_pass(git_oid_fromstr(&oid_src, "2f3053cbff8a4ca2f0666de364ddb734a28a31a9"));
+ cl_git_pass(git_oid__fromstr(&oid_src, "2f3053cbff8a4ca2f0666de364ddb734a28a31a9", GIT_OID_SHA1));
git_oid_cpy(oid1, &oid_src);
- git_oid_fromstr(&oid_src, "f503807ffa920e407a600cfaee96b7152259acc7");
+ git_oid__fromstr(&oid_src, "f503807ffa920e407a600cfaee96b7152259acc7", GIT_OID_SHA1);
cl_git_pass(git_grafts_add(grafts, &oid_src, parents));
git_array_clear(parents);
@@ -75,17 +75,17 @@ void test_grafts_basic__grafted_objects(void)
git_oid oid;
git_commit *commit;
- cl_git_pass(git_oid_fromstr(&oid, "f503807ffa920e407a600cfaee96b7152259acc7"));
+ cl_git_pass(git_oid__fromstr(&oid, "f503807ffa920e407a600cfaee96b7152259acc7", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &oid));
cl_assert_equal_i(1, git_commit_parentcount(commit));
git_commit_free(commit);
- cl_git_pass(git_oid_fromstr(&oid, "0512adebd3782157f0d5c9b22b043f87b4aaff9e"));
+ cl_git_pass(git_oid__fromstr(&oid, "0512adebd3782157f0d5c9b22b043f87b4aaff9e", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &oid));
cl_assert_equal_i(1, git_commit_parentcount(commit));
git_commit_free(commit);
- cl_git_pass(git_oid_fromstr(&oid, "66cc22a015f6ca75b34c82d28f78ba663876bade"));
+ cl_git_pass(git_oid__fromstr(&oid, "66cc22a015f6ca75b34c82d28f78ba663876bade", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &oid));
cl_assert_equal_i(4, git_commit_parentcount(commit));
git_commit_free(commit);
diff --git a/tests/libgit2/grafts/parse.c b/tests/libgit2/grafts/parse.c
index de110c901..149b01c8c 100644
--- a/tests/libgit2/grafts/parse.c
+++ b/tests/libgit2/grafts/parse.c
@@ -46,14 +46,14 @@ static void assert_graft_contains(git_grafts *grafts, const char *graft, size_t
va_list ap;
size_t i = 0;
- cl_git_pass(git_oid_fromstr(&oid, graft));
+ cl_git_pass(git_oid__fromstr(&oid, graft, GIT_OID_SHA1));
cl_git_pass(git_grafts_get(&commit, grafts, &oid));
cl_assert_equal_oid(&commit->oid, &oid);
cl_assert_equal_i(commit->parents.size, n);
va_start(ap, n);
while (i < n) {
- cl_git_pass(git_oid_fromstr(&oid, va_arg(ap, const char *)));
+ cl_git_pass(git_oid__fromstr(&oid, va_arg(ap, const char *), GIT_OID_SHA1));
cl_assert_equal_oid(&commit->parents.ptr[i], &oid);
i++;
}
diff --git a/tests/libgit2/grafts/shallow.c b/tests/libgit2/grafts/shallow.c
index a75b5a051..8c2723922 100644
--- a/tests/libgit2/grafts/shallow.c
+++ b/tests/libgit2/grafts/shallow.c
@@ -20,7 +20,7 @@ void test_grafts_shallow__unset_feature_flag(void)
void test_grafts_shallow__initialize(void)
{
git_libgit2_opts(GIT_OPT_ENABLE_SHALLOW, 1);
- cl_git_pass(git_oid_fromstr(&g_shallow_oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid__fromstr(&g_shallow_oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
}
void test_grafts_shallow__cleanup(void)
@@ -73,7 +73,7 @@ void test_grafts_shallow__cache_clearing(void)
git_grafts *grafts;
git_oid tmp_oid;
- cl_git_pass(git_oid_fromstr(&tmp_oid, "0000000000000000000000000000000000000000"));
+ cl_git_pass(git_oid__fromstr(&tmp_oid, "0000000000000000000000000000000000000000", GIT_OID_SHA1));
g_repo = cl_git_sandbox_init("shallow.git");
cl_git_pass(git_repository_shallow_grafts__weakptr(&grafts, g_repo));