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/apply | |
| 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/apply')
| -rw-r--r-- | tests/libgit2/apply/apply_helpers.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/apply/both.c | 12 | ||||
| -rw-r--r-- | tests/libgit2/apply/callbacks.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/apply/check.c | 6 | ||||
| -rw-r--r-- | tests/libgit2/apply/index.c | 10 | ||||
| -rw-r--r-- | tests/libgit2/apply/tree.c | 6 | ||||
| -rw-r--r-- | tests/libgit2/apply/workdir.c | 8 |
7 files changed, 23 insertions, 23 deletions
diff --git a/tests/libgit2/apply/apply_helpers.c b/tests/libgit2/apply/apply_helpers.c index 91cc51a71..d00e9bdb8 100644 --- a/tests/libgit2/apply/apply_helpers.c +++ b/tests/libgit2/apply/apply_helpers.c @@ -14,7 +14,7 @@ static int iterator_compare(const git_index_entry *entry, void *_data) struct iterator_compare_data *data = (struct iterator_compare_data *)_data; cl_assert_equal_i(GIT_INDEX_ENTRY_STAGE(entry), data->expected[data->idx].stage); - cl_git_pass(git_oid_fromstr(&expected_id, data->expected[data->idx].oid_str)); + cl_git_pass(git_oid_fromstr(&expected_id, data->expected[data->idx].oid_str, GIT_OID_SHA1)); cl_assert_equal_oid(&entry->id, &expected_id); cl_assert_equal_i(entry->mode, data->expected[data->idx].mode); cl_assert_equal_s(entry->path, data->expected[data->idx].path); diff --git a/tests/libgit2/apply/both.c b/tests/libgit2/apply/both.c index 108963270..68a04b82e 100644 --- a/tests/libgit2/apply/both.c +++ b/tests/libgit2/apply/both.c @@ -12,7 +12,7 @@ void test_apply_both__initialize(void) repo = cl_git_sandbox_init(TEST_REPO_PATH); - git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707"); + git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&commit, repo, &oid)); cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL)); git_commit_free(commit); @@ -42,8 +42,8 @@ void test_apply_both__generated_diff(void) size_t both_expected_cnt = sizeof(both_expected) / sizeof(struct merge_index_entry); - git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707"); - git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f"); + git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); + git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid)); cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid)); @@ -192,7 +192,7 @@ void test_apply_both__index_must_match_workdir(void) memset(&idx_entry, 0, sizeof(git_index_entry)); idx_entry.mode = 0100644; idx_entry.path = "asparagus.txt"; - cl_git_pass(git_oid_fromstr(&idx_entry.id, "06d3fefb8726ab1099acc76e02dfb85e034b2538")); + cl_git_pass(git_oid_fromstr(&idx_entry.id, "06d3fefb8726ab1099acc76e02dfb85e034b2538", GIT_OID_SHA1)); cl_git_pass(git_index_add(index, &idx_entry)); cl_git_pass(git_index_write(index)); @@ -290,7 +290,7 @@ void test_apply_both__keeps_nonconflicting_changes(void) memset(&idx_entry, 0, sizeof(git_index_entry)); idx_entry.mode = 0100644; idx_entry.path = "beef.txt"; - cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e")); + cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e", GIT_OID_SHA1)); cl_git_pass(git_index_add(index, &idx_entry)); cl_git_pass(git_index_remove(index, "bouilli.txt", 0)); @@ -386,7 +386,7 @@ void test_apply_both__honors_crlf_attributes(void) cl_git_rmfile("merge-recursive/asparagus.txt"); cl_git_rmfile("merge-recursive/veal.txt"); - git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707"); + git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&commit, repo, &oid)); cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL)); git_commit_free(commit); diff --git a/tests/libgit2/apply/callbacks.c b/tests/libgit2/apply/callbacks.c index 1b759dc9b..7edfd41d9 100644 --- a/tests/libgit2/apply/callbacks.c +++ b/tests/libgit2/apply/callbacks.c @@ -12,7 +12,7 @@ void test_apply_callbacks__initialize(void) repo = cl_git_sandbox_init(TEST_REPO_PATH); - git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707"); + git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&commit, repo, &oid)); cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL)); git_commit_free(commit); diff --git a/tests/libgit2/apply/check.c b/tests/libgit2/apply/check.c index 9e42365ed..79a418143 100644 --- a/tests/libgit2/apply/check.c +++ b/tests/libgit2/apply/check.c @@ -12,7 +12,7 @@ void test_apply_check__initialize(void) repo = cl_git_sandbox_init(TEST_REPO_PATH); - git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707"); + git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&commit, repo, &oid)); cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL)); git_commit_free(commit); @@ -32,8 +32,8 @@ void test_apply_check__generate_diff(void) git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT; git_apply_options opts = GIT_APPLY_OPTIONS_INIT; - cl_git_pass(git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707")); - cl_git_pass(git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f")); + cl_git_pass(git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1)); + cl_git_pass(git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1)); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid)); cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid)); diff --git a/tests/libgit2/apply/index.c b/tests/libgit2/apply/index.c index 9c9094cce..43bb89f2a 100644 --- a/tests/libgit2/apply/index.c +++ b/tests/libgit2/apply/index.c @@ -12,7 +12,7 @@ void test_apply_index__initialize(void) repo = cl_git_sandbox_init(TEST_REPO_PATH); - git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707"); + git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&commit, repo, &oid)); cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL)); git_commit_free(commit); @@ -42,8 +42,8 @@ void test_apply_index__generate_diff(void) size_t index_expected_cnt = sizeof(index_expected) / sizeof(struct merge_index_entry); - git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707"); - git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f"); + git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); + git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid)); cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid)); @@ -233,7 +233,7 @@ void test_apply_index__keeps_nonconflicting_changes(void) memset(&idx_entry, 0, sizeof(git_index_entry)); idx_entry.mode = 0100644; idx_entry.path = "beef.txt"; - cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e")); + cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e", GIT_OID_SHA1)); cl_git_pass(git_index_add(index, &idx_entry)); cl_git_pass(git_index_remove(index, "bouilli.txt", 0)); @@ -279,7 +279,7 @@ void test_apply_index__can_apply_nonconflicting_file_changes(void) memset(&idx_entry, 0, sizeof(git_index_entry)); idx_entry.mode = 0100644; idx_entry.path = "asparagus.txt"; - cl_git_pass(git_oid_fromstr(&idx_entry.id, "06d3fefb8726ab1099acc76e02dfb85e034b2538")); + cl_git_pass(git_oid_fromstr(&idx_entry.id, "06d3fefb8726ab1099acc76e02dfb85e034b2538", GIT_OID_SHA1)); cl_git_pass(git_index_add(index, &idx_entry)); cl_git_pass(git_index_write(index)); diff --git a/tests/libgit2/apply/tree.c b/tests/libgit2/apply/tree.c index 5154f134f..bc73893f7 100644 --- a/tests/libgit2/apply/tree.c +++ b/tests/libgit2/apply/tree.c @@ -35,8 +35,8 @@ void test_apply_tree__one(void) { 0100644, "a7b066537e6be7109abfe4ff97b675d4e077da20", 0, "veal.txt" }, }; - git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707"); - git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f"); + git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); + git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid)); cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid)); @@ -75,7 +75,7 @@ void test_apply_tree__adds_file(void) { 0100644, "94d2c01087f48213bd157222d54edfefd77c9bba", 0, "veal.txt" }, }; - git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707"); + git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid)); diff --git a/tests/libgit2/apply/workdir.c b/tests/libgit2/apply/workdir.c index d0d9c1aba..bcc45107c 100644 --- a/tests/libgit2/apply/workdir.c +++ b/tests/libgit2/apply/workdir.c @@ -12,7 +12,7 @@ void test_apply_workdir__initialize(void) repo = cl_git_sandbox_init(TEST_REPO_PATH); - git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707"); + git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&commit, repo, &oid)); cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL)); git_commit_free(commit); @@ -42,8 +42,8 @@ void test_apply_workdir__generated_diff(void) size_t workdir_expected_cnt = sizeof(workdir_expected) / sizeof(struct merge_index_entry); - git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707"); - git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f"); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid)); + git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1); + git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid)); cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid)); cl_git_pass(git_commit_tree(&a_tree, a_commit)); @@ -171,7 +171,7 @@ void test_apply_workdir__modified_index_with_unmodified_workdir_is_ok(void) idx_entry.mode = 0100644; idx_entry.path = "veal.txt"; - cl_git_pass(git_oid_fromstr(&idx_entry.id, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d")); + cl_git_pass(git_oid_fromstr(&idx_entry.id, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", GIT_OID_SHA1)); cl_git_pass(git_index_add(index, &idx_entry)); cl_git_pass(git_index_remove(index, "asparagus.txt", 0)); |
