diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2022-01-23 09:47:01 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-06-20 17:05:29 -0400 |
commit | 3fbf580c91935ccdea25a135204419991f503b63 (patch) | |
tree | 53ec861796641faf8895a1f19444c1939ac6be9a /tests/libgit2/checkout/tree.c | |
parent | 61838295a055c8c7a4a7eb730538c6e08a38dd6a (diff) | |
download | libgit2-3fbf580c91935ccdea25a135204419991f503b63.tar.gz |
oid: give oids a type
`git_oid`s now have a type, and we require the oid type when creating
the object id from creation functions.
Diffstat (limited to 'tests/libgit2/checkout/tree.c')
-rw-r--r-- | tests/libgit2/checkout/tree.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/libgit2/checkout/tree.c b/tests/libgit2/checkout/tree.c index d4b57f5d1..b4b61a2e0 100644 --- a/tests/libgit2/checkout/tree.c +++ b/tests/libgit2/checkout/tree.c @@ -139,8 +139,8 @@ void test_checkout_tree__doesnt_write_unrequested_files_to_worktree(void) git_commit* p_chomped_commit; git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - git_oid_fromstr(&master_oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); - git_oid_fromstr(&chomped_oid, "e90810b8df3e80c413d903f631643c716887138d"); + git_oid_fromstr(&master_oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1); + git_oid_fromstr(&chomped_oid, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&p_master_commit, g_repo, &master_oid)); cl_git_pass(git_commit_lookup(&p_chomped_commit, g_repo, &chomped_oid)); @@ -615,7 +615,7 @@ void test_checkout_tree__donot_update_deleted_file_by_default(void) cl_git_pass(git_repository_index(&index, g_repo)); - cl_git_pass(git_oid_fromstr(&old_id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); + cl_git_pass(git_oid_fromstr(&old_id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&old_commit, g_repo, &old_id)); cl_git_pass(git_reset(g_repo, (git_object *)old_commit, GIT_RESET_HARD, NULL)); @@ -625,7 +625,7 @@ void test_checkout_tree__donot_update_deleted_file_by_default(void) cl_assert(!git_fs_path_exists("testrepo/branch_file.txt")); - cl_git_pass(git_oid_fromstr(&new_id, "099fabac3a9ea935598528c27f866e34089c2eff")); + cl_git_pass(git_oid_fromstr(&new_id, "099fabac3a9ea935598528c27f866e34089c2eff", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&new_commit, g_repo, &new_id)); @@ -941,16 +941,16 @@ static void create_conflict(const char *path) memset(&entry, 0x0, sizeof(git_index_entry)); entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&entry, 1); - git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46"); + git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46", GIT_OID_SHA1); entry.path = path; cl_git_pass(git_index_add(index, &entry)); GIT_INDEX_ENTRY_STAGE_SET(&entry, 2); - git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); + git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1); cl_git_pass(git_index_add(index, &entry)); GIT_INDEX_ENTRY_STAGE_SET(&entry, 3); - git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863"); + git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863", GIT_OID_SHA1); cl_git_pass(git_index_add(index, &entry)); cl_git_pass(git_index_write(index)); @@ -988,7 +988,7 @@ void test_checkout_tree__filemode_preserved_in_index(void) cl_git_pass(git_repository_index(&index, g_repo)); /* test a freshly added executable */ - cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6")); + cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); @@ -999,7 +999,7 @@ void test_checkout_tree__filemode_preserved_in_index(void) /* Now start with a commit which has a text file */ - cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9")); + cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); @@ -1010,7 +1010,7 @@ void test_checkout_tree__filemode_preserved_in_index(void) /* And then check out to a commit which converts the text file to an executable */ - cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e")); + cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); @@ -1021,7 +1021,7 @@ void test_checkout_tree__filemode_preserved_in_index(void) /* Finally, check out the text file again and check that the exec bit is cleared */ - cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9")); + cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); @@ -1063,7 +1063,7 @@ void test_checkout_tree__filemode_preserved_in_workdir(void) opts.checkout_strategy = GIT_CHECKOUT_FORCE; /* test a freshly added executable */ - cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6")); + cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); @@ -1073,7 +1073,7 @@ void test_checkout_tree__filemode_preserved_in_workdir(void) /* Now start with a commit which has a text file */ - cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9")); + cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); @@ -1083,7 +1083,7 @@ void test_checkout_tree__filemode_preserved_in_workdir(void) /* And then check out to a commit which converts the text file to an executable */ - cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e")); + cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); @@ -1093,7 +1093,7 @@ void test_checkout_tree__filemode_preserved_in_workdir(void) /* Finally, check out the text file again and check that the exec bit is cleared */ - cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9")); + cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); @@ -1112,7 +1112,7 @@ void test_checkout_tree__removes_conflicts(void) git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_index *index; - cl_git_pass(git_oid_fromstr(&commit_id, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6")); + cl_git_pass(git_oid_fromstr(&commit_id, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &commit_id)); opts.checkout_strategy = GIT_CHECKOUT_FORCE; @@ -1155,7 +1155,7 @@ void test_checkout_tree__removes_conflicts_only_by_pathscope(void) git_index *index; const char *path = "executable.txt"; - cl_git_pass(git_oid_fromstr(&commit_id, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6")); + cl_git_pass(git_oid_fromstr(&commit_id, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&commit, g_repo, &commit_id)); opts.checkout_strategy = GIT_CHECKOUT_FORCE; @@ -1583,7 +1583,7 @@ static void modify_index_ondisk(void) cl_git_pass(git_repository_open(&other_repo, git_repository_workdir(g_repo))); cl_git_pass(git_repository_index(&other_index, other_repo)); - cl_git_pass(git_oid_fromstr(&entry.id, "1385f264afb75a56a5bec74243be9b367ba4ca08")); + cl_git_pass(git_oid_fromstr(&entry.id, "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OID_SHA1)); entry.mode = 0100644; entry.path = "README"; |