From 3fbf580c91935ccdea25a135204419991f503b63 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sun, 23 Jan 2022 09:47:01 -0500 Subject: 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. --- tests/libgit2/diff/blob.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'tests/libgit2/diff/blob.c') diff --git a/tests/libgit2/diff/blob.c b/tests/libgit2/diff/blob.c index d2f42207d..f06f884d4 100644 --- a/tests/libgit2/diff/blob.c +++ b/tests/libgit2/diff/blob.c @@ -45,11 +45,11 @@ void test_diff_blob__initialize(void) memset(&expected, 0, sizeof(expected)); /* tests/resources/attr/root_test4.txt */ - cl_git_pass(git_oid_fromstrn(&oid, "a0f7217a", 8)); + cl_git_pass(git_oid_fromstrn(&oid, "a0f7217a", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&d, g_repo, &oid, 8)); /* alien.png */ - cl_git_pass(git_oid_fromstrn(&oid, "edf3dcee", 8)); + cl_git_pass(git_oid_fromstrn(&oid, "edf3dcee", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&alien, g_repo, &oid, 8)); } @@ -86,10 +86,10 @@ void test_diff_blob__patch_with_freed_blobs(void) git_buf buf = GIT_BUF_INIT; /* tests/resources/attr/root_test1 */ - cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8)); + cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 4)); /* tests/resources/attr/root_test2 */ - cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8)); + cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&b, g_repo, &b_oid, 4)); cl_git_pass(git_patch_from_blobs(&p, a, NULL, b, NULL, NULL)); @@ -110,15 +110,15 @@ void test_diff_blob__can_compare_text_blobs(void) git_oid a_oid, b_oid, c_oid; /* tests/resources/attr/root_test1 */ - cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8)); + cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 4)); /* tests/resources/attr/root_test2 */ - cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8)); + cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&b, g_repo, &b_oid, 4)); /* tests/resources/attr/root_test3 */ - cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16)); + cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&c, g_repo, &c_oid, 16)); /* Doing the equivalent of a `git diff -U1` on these files */ @@ -201,15 +201,15 @@ void test_diff_blob__can_compare_text_blobs_with_patch(void) git_patch *p; /* tests/resources/attr/root_test1 */ - cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8)); + cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8)); /* tests/resources/attr/root_test2 */ - cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8)); + cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&b, g_repo, &b_oid, 8)); /* tests/resources/attr/root_test3 */ - cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16)); + cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&c, g_repo, &c_oid, 16)); /* Doing the equivalent of a `git diff -U1` on these files */ @@ -475,7 +475,7 @@ void test_diff_blob__can_compare_two_binary_blobs(void) git_oid h_oid; /* heart.png */ - cl_git_pass(git_oid_fromstrn(&h_oid, "de863bff", 8)); + cl_git_pass(git_oid_fromstrn(&h_oid, "de863bff", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&heart, g_repo, &h_oid, 8)); cl_git_pass(git_diff_blobs( @@ -543,7 +543,7 @@ void test_diff_blob__comparing_two_text_blobs_honors_interhunkcontext(void) opts.context_lines = 3; /* tests/resources/attr/root_test1 from commit f5b0af1 */ - cl_git_pass(git_oid_fromstrn(&old_d_oid, "fe773770", 8)); + cl_git_pass(git_oid_fromstrn(&old_d_oid, "fe773770", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&old_d, g_repo, &old_d_oid, 8)); /* Test with default inter-hunk-context (not set) => default is 0 */ @@ -652,7 +652,7 @@ void test_diff_blob__can_compare_blob_to_buffer(void) const char *b_content = "Hello from the root\n\nSome additional lines\n\nDown here below\n\n"; /* tests/resources/attr/root_test1 */ - cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8)); + cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8)); /* diff from blob a to content of b */ @@ -694,7 +694,7 @@ void test_diff_blob__can_compare_blob_to_buffer_with_patch(void) size_t tc, ta, td; /* tests/resources/attr/root_test1 */ - cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8)); + cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8)); /* diff from blob a to content of b */ @@ -773,10 +773,10 @@ void test_diff_blob__binary_data_comparisons(void) opts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED; - cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8)); + cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&nonbin, g_repo, &oid, 8)); - cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8)); + cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&bin, g_repo, &oid, 8)); /* non-binary to reference content */ @@ -879,11 +879,11 @@ void test_diff_blob__using_path_and_attributes(void) opts.context_lines = 0; opts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED; - cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8)); + cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&nonbin, g_repo, &oid, 8)); /* 20b: "Hello from the root\n" */ - cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8)); + cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8, GIT_OID_SHA1)); cl_git_pass(git_blob_lookup_prefix(&bin, g_repo, &oid, 8)); /* 33b: "0123456789\n\x01\x02\x03\x04\x05\x06\x07\x08\x09\n0123456789\n" */ -- cgit v1.2.1