summaryrefslogtreecommitdiff
path: root/tests/libgit2/diff/blob.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-23 09:47:01 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-20 17:05:29 -0400
commit3fbf580c91935ccdea25a135204419991f503b63 (patch)
tree53ec861796641faf8895a1f19444c1939ac6be9a /tests/libgit2/diff/blob.c
parent61838295a055c8c7a4a7eb730538c6e08a38dd6a (diff)
downloadlibgit2-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/diff/blob.c')
-rw-r--r--tests/libgit2/diff/blob.c36
1 files changed, 18 insertions, 18 deletions
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" */