diff options
Diffstat (limited to 'tests/libgit2/index')
| -rw-r--r-- | tests/libgit2/index/add.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/index/bypath.c | 6 | ||||
| -rw-r--r-- | tests/libgit2/index/cache.c | 16 | ||||
| -rw-r--r-- | tests/libgit2/index/conflicts.c | 74 | ||||
| -rw-r--r-- | tests/libgit2/index/crlf.c | 17 | ||||
| -rw-r--r-- | tests/libgit2/index/names.c | 6 | ||||
| -rw-r--r-- | tests/libgit2/index/read_index.c | 14 | ||||
| -rw-r--r-- | tests/libgit2/index/rename.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/index/reuc.c | 70 | ||||
| -rw-r--r-- | tests/libgit2/index/tests.c | 16 |
10 files changed, 112 insertions, 111 deletions
diff --git a/tests/libgit2/index/add.c b/tests/libgit2/index/add.c index f101ea266..6b285fdeb 100644 --- a/tests/libgit2/index/add.c +++ b/tests/libgit2/index/add.c @@ -28,7 +28,7 @@ static void test_add_entry( { git_index_entry entry = {{0}}; - cl_git_pass(git_oid_fromstr(&entry.id, idstr)); + cl_git_pass(git_oid_fromstr(&entry.id, idstr, GIT_OID_SHA1)); entry.path = mode == GIT_FILEMODE_TREE ? "test_folder" : "test_file"; entry.mode = mode; diff --git a/tests/libgit2/index/bypath.c b/tests/libgit2/index/bypath.c index b32a0a789..5e6eb8371 100644 --- a/tests/libgit2/index/bypath.c +++ b/tests/libgit2/index/bypath.c @@ -131,7 +131,7 @@ void test_index_bypath__add_honors_existing_case_2(void) clar__skip(); dummy.mode = GIT_FILEMODE_BLOB; - cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b")); + cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b", GIT_OID_SHA1)); /* note that `git_index_add` does no checking to canonical directories */ dummy.path = "Just_a_dir/file0.txt"; @@ -187,7 +187,7 @@ void test_index_bypath__add_honors_existing_case_3(void) clar__skip(); dummy.mode = GIT_FILEMODE_BLOB; - cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b")); + cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b", GIT_OID_SHA1)); dummy.path = "just_a_dir/filea.txt"; cl_git_pass(git_index_add(g_idx, &dummy)); @@ -218,7 +218,7 @@ void test_index_bypath__add_honors_existing_case_4(void) clar__skip(); dummy.mode = GIT_FILEMODE_BLOB; - cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b")); + cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b", GIT_OID_SHA1)); dummy.path = "just_a_dir/a/b/c/d/e/file1.txt"; cl_git_pass(git_index_add(g_idx, &dummy)); diff --git a/tests/libgit2/index/cache.c b/tests/libgit2/index/cache.c index 56885aff7..ce55ac413 100644 --- a/tests/libgit2/index/cache.c +++ b/tests/libgit2/index/cache.c @@ -26,7 +26,7 @@ void test_index_cache__write_extension_at_root(void) cl_git_pass(git_index_open(&index, index_file)); cl_assert(index->tree == NULL); - cl_git_pass(git_oid_fromstr(&id, tree_id_str)); + cl_git_pass(git_oid_fromstr(&id, tree_id_str, GIT_OID_SHA1)); cl_git_pass(git_tree_lookup(&tree, g_repo, &id)); cl_git_pass(git_index_read_tree(index, tree)); git_tree_free(tree); @@ -58,7 +58,7 @@ void test_index_cache__write_extension_invalidated_root(void) cl_git_pass(git_index_open(&index, index_file)); cl_assert(index->tree == NULL); - cl_git_pass(git_oid_fromstr(&id, tree_id_str)); + cl_git_pass(git_oid_fromstr(&id, tree_id_str, GIT_OID_SHA1)); cl_git_pass(git_tree_lookup(&tree, g_repo, &id)); cl_git_pass(git_index_read_tree(index, tree)); git_tree_free(tree); @@ -98,7 +98,7 @@ void test_index_cache__read_tree_no_children(void) cl_git_pass(git_index_new(&index)); cl_assert(index->tree == NULL); - cl_git_pass(git_oid_fromstr(&id, "45dd856fdd4d89b884c340ba0e047752d9b085d6")); + cl_git_pass(git_oid_fromstr(&id, "45dd856fdd4d89b884c340ba0e047752d9b085d6", GIT_OID_SHA1)); cl_git_pass(git_tree_lookup(&tree, g_repo, &id)); cl_git_pass(git_index_read_tree(index, tree)); git_tree_free(tree); @@ -111,7 +111,7 @@ void test_index_cache__read_tree_no_children(void) memset(&entry, 0x0, sizeof(git_index_entry)); entry.path = "new.txt"; entry.mode = GIT_FILEMODE_BLOB; - git_oid_fromstr(&entry.id, "d4bcc68acd4410bf836a39f20afb2c2ece09584e"); + git_oid_fromstr(&entry.id, "d4bcc68acd4410bf836a39f20afb2c2ece09584e", GIT_OID_SHA1); cl_git_pass(git_index_add(index, &entry)); cl_assert_equal_i(-1, index->tree->entry_count); @@ -132,7 +132,7 @@ void test_index_cache__two_levels(void) memset(&entry, 0x0, sizeof(entry)); entry.mode = GIT_FILEMODE_BLOB; - cl_git_pass(git_oid_fromstr(&entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); + cl_git_pass(git_oid_fromstr(&entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1)); entry.path = "top-level.txt"; cl_git_pass(git_index_add(index, &entry)); @@ -156,7 +156,7 @@ void test_index_cache__two_levels(void) cl_assert(git_tree_cache_get(index->tree, "subdir")); entry.path = "top-level.txt"; - cl_git_pass(git_oid_fromstr(&entry.id, "3697d64be941a53d4ae8f6a271e4e3fa56b022cc")); + cl_git_pass(git_oid_fromstr(&entry.id, "3697d64be941a53d4ae8f6a271e4e3fa56b022cc", GIT_OID_SHA1)); cl_git_pass(git_index_add(index, &entry)); /* writ out the index after we invalidate the root */ @@ -191,7 +191,7 @@ void test_index_cache__read_tree_children(void) memset(&entry, 0x0, sizeof(git_index_entry)); entry.path = "top-level"; entry.mode = GIT_FILEMODE_BLOB; - git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); + git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1); cl_git_pass(git_index_add(index, &entry)); @@ -217,7 +217,7 @@ void test_index_cache__read_tree_children(void) /* override with a slightly different id, also dummy */ entry.path = "subdir/some-file"; - git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); + git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1); cl_git_pass(git_index_add(index, &entry)); cl_assert_equal_i(-1, index->tree->entry_count); diff --git a/tests/libgit2/index/conflicts.c b/tests/libgit2/index/conflicts.c index 41d0e219c..a837dcff4 100644 --- a/tests/libgit2/index/conflicts.c +++ b/tests/libgit2/index/conflicts.c @@ -37,17 +37,17 @@ void test_index_conflicts__add(void) ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1); - git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); our_entry.path = "test-one.txt"; our_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2); - git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1); their_entry.path = "test-one.txt"; their_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 2); - git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); @@ -68,17 +68,17 @@ void test_index_conflicts__add_fixes_incorrect_stage(void) ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3); - git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); our_entry.path = "test-one.txt"; our_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1); - git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1); their_entry.path = "test-one.txt"; their_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2); - git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); @@ -111,17 +111,17 @@ void test_index_conflicts__add_detects_invalid_filemode(void) ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3); - git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); our_entry.path = "test-one.txt"; our_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1); - git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1); their_entry.path = "test-one.txt"; their_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2); - git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1); /* Corrupt the conflict entry's mode */ conflict_entry[i]->mode = 027431745; @@ -151,17 +151,17 @@ void test_index_conflicts__add_removes_stage_zero(void) ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3); - git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); our_entry.path = "test-one.txt"; our_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1); - git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1); their_entry.path = "test-one.txt"; their_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2); - git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); @@ -189,13 +189,13 @@ void test_index_conflicts__get(void) cl_assert_equal_s("conflicts-one.txt", conflict_entry[0]->path); - git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[0]->id); - git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID); + git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[1]->id); - git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID); + git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[2]->id); cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1], @@ -203,13 +203,13 @@ void test_index_conflicts__get(void) cl_assert_equal_s("conflicts-two.txt", conflict_entry[0]->path); - git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[0]->id); - git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[1]->id); - git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[2]->id); } @@ -223,29 +223,29 @@ void test_index_conflicts__iterate(void) cl_git_pass(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator)); - git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[0]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0); - git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID); + git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[1]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0); - git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID); + git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[2]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0); cl_git_pass(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator)); - git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[0]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0); - git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[1]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0); - git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[2]->id); cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0); @@ -357,7 +357,7 @@ void test_index_conflicts__partial(void) ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1); - git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, NULL, NULL)); cl_assert(git_index_entrycount(repo_index) == 9); @@ -387,17 +387,17 @@ void test_index_conflicts__case_matters(void) ancestor_entry.path = upper_case; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR); - git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); ancestor_entry.mode = GIT_FILEMODE_BLOB; our_entry.path = upper_case; GIT_INDEX_ENTRY_STAGE_SET(&our_entry, GIT_INDEX_STAGE_OURS); - git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1); our_entry.mode = GIT_FILEMODE_BLOB; their_entry.path = upper_case; GIT_INDEX_ENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS); - git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1); their_entry.mode = GIT_FILEMODE_BLOB; cl_git_pass(git_index_conflict_add(repo_index, @@ -405,17 +405,17 @@ void test_index_conflicts__case_matters(void) ancestor_entry.path = mixed_case; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR); - git_oid_fromstr(&ancestor_entry.id, CONFLICTS_TWO_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_TWO_ANCESTOR_OID, GIT_OID_SHA1); ancestor_entry.mode = GIT_FILEMODE_BLOB; our_entry.path = mixed_case; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR); - git_oid_fromstr(&our_entry.id, CONFLICTS_TWO_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_TWO_OUR_OID, GIT_OID_SHA1); ancestor_entry.mode = GIT_FILEMODE_BLOB; their_entry.path = mixed_case; GIT_INDEX_ENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS); - git_oid_fromstr(&their_entry.id, CONFLICTS_TWO_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_TWO_THEIR_OID, GIT_OID_SHA1); their_entry.mode = GIT_FILEMODE_BLOB; cl_git_pass(git_index_conflict_add(repo_index, @@ -434,29 +434,29 @@ void test_index_conflicts__case_matters(void) correct_case = upper_case; cl_assert_equal_s(correct_case, conflict_entry[0]->path); - git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_ANCESTOR_OID : CONFLICTS_ONE_ANCESTOR_OID); + git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_ANCESTOR_OID : CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[0]->id); cl_assert_equal_s(correct_case, conflict_entry[1]->path); - git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_OUR_OID : CONFLICTS_ONE_OUR_OID); + git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_OUR_OID : CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[1]->id); cl_assert_equal_s(correct_case, conflict_entry[2]->path); - git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_THEIR_OID : CONFLICTS_ONE_THEIR_OID); + git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_THEIR_OID : CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[2]->id); cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], repo_index, mixed_case)); cl_assert_equal_s(mixed_case, conflict_entry[0]->path); - git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[0]->id); cl_assert_equal_s(mixed_case, conflict_entry[1]->path); - git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[1]->id); cl_assert_equal_s(mixed_case, conflict_entry[2]->path); - git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID); + git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&oid, &conflict_entry[2]->id); } diff --git a/tests/libgit2/index/crlf.c b/tests/libgit2/index/crlf.c index 7520c23a3..a0eb94baa 100644 --- a/tests/libgit2/index/crlf.c +++ b/tests/libgit2/index/crlf.c @@ -244,7 +244,8 @@ void test_index_crlf__autocrlf_false_no_attrs(void) entry = git_index_get_bypath(g_index, "newfile.txt", 0); cl_git_pass(git_oid_fromstr(&oid, - (GIT_EOL_NATIVE == GIT_EOL_CRLF) ? FILE_OID_CRLF : FILE_OID_LF)); + (GIT_EOL_NATIVE == GIT_EOL_CRLF) ? FILE_OID_CRLF : FILE_OID_LF, + GIT_OID_SHA1)); cl_assert_equal_oid(&oid, &entry->id); } @@ -261,7 +262,7 @@ void test_index_crlf__autocrlf_true_no_attrs(void) cl_git_pass(git_index_add_bypath(g_index, "newfile.txt")); entry = git_index_get_bypath(g_index, "newfile.txt", 0); - cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); + cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1)); cl_assert_equal_oid(&oid, &entry->id); } @@ -278,7 +279,7 @@ void test_index_crlf__autocrlf_input_no_attrs(void) cl_git_pass(git_index_add_bypath(g_index, "newfile.txt")); entry = git_index_get_bypath(g_index, "newfile.txt", 0); - cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); + cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1)); cl_assert_equal_oid(&oid, &entry->id); } @@ -297,7 +298,7 @@ void test_index_crlf__autocrlf_false_text_auto_attr(void) cl_git_pass(git_index_add_bypath(g_index, "newfile.txt")); entry = git_index_get_bypath(g_index, "newfile.txt", 0); - cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); + cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1)); cl_assert_equal_oid(&oid, &entry->id); } @@ -316,7 +317,7 @@ void test_index_crlf__autocrlf_true_text_auto_attr(void) cl_git_pass(git_index_add_bypath(g_index, "newfile.txt")); entry = git_index_get_bypath(g_index, "newfile.txt", 0); - cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); + cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1)); cl_assert_equal_oid(&oid, &entry->id); } @@ -335,7 +336,7 @@ void test_index_crlf__autocrlf_input_text_auto_attr(void) cl_git_pass(git_index_add_bypath(g_index, "newfile.txt")); entry = git_index_get_bypath(g_index, "newfile.txt", 0); - cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); + cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1)); cl_assert_equal_oid(&oid, &entry->id); } @@ -355,7 +356,7 @@ void test_index_crlf__safecrlf_true_autocrlf_input_text_auto_attr(void) entry = git_index_get_bypath(g_index, "newfile.txt", 0); cl_assert(entry); - cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); + cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1)); cl_assert_equal_oid(&oid, &entry->id); cl_git_mkfile("./crlf/newfile2.txt", FILE_CONTENTS_CRLF); @@ -376,7 +377,7 @@ void test_index_crlf__safecrlf_true_autocrlf_input_text__no_attr(void) entry = git_index_get_bypath(g_index, "newfile.txt", 0); cl_assert(entry); - cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF)); + cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1)); cl_assert_equal_oid(&oid, &entry->id); cl_git_mkfile("./crlf/newfile2.txt", FILE_CONTENTS_CRLF); diff --git a/tests/libgit2/index/names.c b/tests/libgit2/index/names.c index 369318b03..48934de26 100644 --- a/tests/libgit2/index/names.c +++ b/tests/libgit2/index/names.c @@ -42,21 +42,21 @@ static void index_add_conflicts(void) entry.path = conflict[0]; entry.mode = GIT_FILEMODE_BLOB; GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_ANCESTOR); - git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81"); + git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81", GIT_OID_SHA1); cl_git_pass(git_index_add(repo_index, &entry)); /* ours */ entry.path = conflict[1]; entry.mode = GIT_FILEMODE_BLOB; GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_OURS); - git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81"); + git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81", GIT_OID_SHA1); cl_git_pass(git_index_add(repo_index, &entry)); /* theirs */ entry.path = conflict[2]; entry.mode = GIT_FILEMODE_BLOB; GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_THEIRS); - git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81"); + git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81", GIT_OID_SHA1); cl_git_pass(git_index_add(repo_index, &entry)); } } diff --git a/tests/libgit2/index/read_index.c b/tests/libgit2/index/read_index.c index 836c12b0e..e44574de3 100644 --- a/tests/libgit2/index/read_index.c +++ b/tests/libgit2/index/read_index.c @@ -49,7 +49,7 @@ void test_index_read_index__maintains_stat_cache(void) /* add a new entry that will not have stat data */ memset(&new_entry, 0, sizeof(git_index_entry)); new_entry.path = "Hello"; - git_oid_fromstr(&new_entry.id, "0123456789012345678901234567890123456789"); + git_oid_fromstr(&new_entry.id, "0123456789012345678901234567890123456789", GIT_OID_SHA1); new_entry.file_size = 1234; new_entry.mode = 0100644; cl_git_pass(git_index_add(new_index, &new_entry)); @@ -79,7 +79,7 @@ static bool roundtrip_with_read_index(const char *tree_idstr) git_tree *tree; git_index *tree_index; - cl_git_pass(git_oid_fromstr(&tree_id, tree_idstr)); + cl_git_pass(git_oid_fromstr(&tree_id, tree_idstr, GIT_OID_SHA1)); cl_git_pass(git_tree_lookup(&tree, _repo, &tree_id)); cl_git_pass(git_index_new(&tree_index)); cl_git_pass(git_index_read_tree(tree_index, tree)); @@ -111,7 +111,7 @@ void test_index_read_index__read_and_writes(void) git_tree *tree; git_index *tree_index, *new_index; - cl_git_pass(git_oid_fromstr(&tree_id, "ae90f12eea699729ed24555e40b9fd669da12a12")); + cl_git_pass(git_oid_fromstr(&tree_id, "ae90f12eea699729ed24555e40b9fd669da12a12", GIT_OID_SHA1)); cl_git_pass(git_tree_lookup(&tree, _repo, &tree_id)); cl_git_pass(git_index_new(&tree_index)); cl_git_pass(git_index_read_tree(tree_index, tree)); @@ -148,17 +148,17 @@ static void add_conflicts(git_index *index, const char *filename) ancestor_entry.path = filename; ancestor_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1); - git_oid_fromstr(&ancestor_entry.id, ancestor_ids[conflict_idx]); + git_oid_fromstr(&ancestor_entry.id, ancestor_ids[conflict_idx], GIT_OID_SHA1); our_entry.path = filename; our_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2); - git_oid_fromstr(&our_entry.id, our_ids[conflict_idx]); + git_oid_fromstr(&our_entry.id, our_ids[conflict_idx], GIT_OID_SHA1); their_entry.path = filename; their_entry.mode = 0100644; GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 2); - git_oid_fromstr(&their_entry.id, their_ids[conflict_idx]); + git_oid_fromstr(&their_entry.id, their_ids[conflict_idx], GIT_OID_SHA1); cl_git_pass(git_index_conflict_add(index, &ancestor_entry, &our_entry, &their_entry)); @@ -172,7 +172,7 @@ void test_index_read_index__handles_conflicts(void) git_index_conflict_iterator *conflict_iterator; const git_index_entry *ancestor, *ours, *theirs; - cl_git_pass(git_oid_fromstr(&tree_id, "ae90f12eea699729ed24555e40b9fd669da12a12")); + cl_git_pass(git_oid_fromstr(&tree_id, "ae90f12eea699729ed24555e40b9fd669da12a12", GIT_OID_SHA1)); cl_git_pass(git_tree_lookup(&tree, _repo, &tree_id)); cl_git_pass(git_index_new(&index)); cl_git_pass(git_index_new(&new_index)); diff --git a/tests/libgit2/index/rename.c b/tests/libgit2/index/rename.c index 86eaf0053..8d5d59d57 100644 --- a/tests/libgit2/index/rename.c +++ b/tests/libgit2/index/rename.c @@ -22,7 +22,7 @@ void test_index_rename__single_file(void) cl_git_pass(git_index_add_bypath(index, "lame.name.txt")); cl_assert(git_index_entrycount(index) == 1); - cl_git_pass(git_oid_fromstr(&expected, "d4fa8600b4f37d7516bef4816ae2c64dbf029e3a")); + cl_git_pass(git_oid_fromstr(&expected, "d4fa8600b4f37d7516bef4816ae2c64dbf029e3a", GIT_OID_SHA1)); cl_assert(!git_index_find(&position, index, "lame.name.txt")); diff --git a/tests/libgit2/index/reuc.c b/tests/libgit2/index/reuc.c index 1f95c4136..7468884c5 100644 --- a/tests/libgit2/index/reuc.c +++ b/tests/libgit2/index/reuc.c @@ -38,9 +38,9 @@ void test_index_reuc__add(void) git_oid ancestor_oid, our_oid, their_oid; const git_index_reuc_entry *reuc; - git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID); - git_oid_fromstr(&our_oid, ONE_OUR_OID); - git_oid_fromstr(&their_oid, ONE_THEIR_OID); + git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID, GIT_OID_SHA1); + git_oid_fromstr(&our_oid, ONE_OUR_OID, GIT_OID_SHA1); + git_oid_fromstr(&their_oid, ONE_THEIR_OID, GIT_OID_SHA1); cl_git_pass(git_index_reuc_add(repo_index, "newfile.txt", 0100644, &ancestor_oid, @@ -66,8 +66,8 @@ void test_index_reuc__add_no_ancestor(void) const git_index_reuc_entry *reuc; memset(&ancestor_oid, 0x0, sizeof(git_oid)); - git_oid_fromstr(&our_oid, ONE_OUR_OID); - git_oid_fromstr(&their_oid, ONE_THEIR_OID); + git_oid_fromstr(&our_oid, ONE_OUR_OID, GIT_OID_SHA1); + git_oid_fromstr(&their_oid, ONE_THEIR_OID, GIT_OID_SHA1); cl_git_pass(git_index_reuc_add(repo_index, "newfile.txt", 0, NULL, @@ -100,11 +100,11 @@ void test_index_reuc__read_bypath(void) cl_assert(reuc->mode[0] == 0100644); cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); - git_oid_fromstr(&oid, TWO_ANCESTOR_OID); + git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[0], &oid); - git_oid_fromstr(&oid, TWO_OUR_OID); + git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[1], &oid); - git_oid_fromstr(&oid, TWO_THEIR_OID); + git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[2], &oid); cl_assert(reuc = git_index_reuc_get_bypath(repo_index, "one.txt")); @@ -113,11 +113,11 @@ void test_index_reuc__read_bypath(void) cl_assert(reuc->mode[0] == 0100644); cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); - git_oid_fromstr(&oid, ONE_ANCESTOR_OID); + git_oid_fromstr(&oid, ONE_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[0], &oid); - git_oid_fromstr(&oid, ONE_OUR_OID); + git_oid_fromstr(&oid, ONE_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[1], &oid); - git_oid_fromstr(&oid, ONE_THEIR_OID); + git_oid_fromstr(&oid, ONE_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[2], &oid); } @@ -145,11 +145,11 @@ void test_index_reuc__ignore_case(void) cl_assert(reuc->mode[0] == 0100644); cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); - git_oid_fromstr(&oid, TWO_ANCESTOR_OID); + git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[0], &oid); - git_oid_fromstr(&oid, TWO_OUR_OID); + git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[1], &oid); - git_oid_fromstr(&oid, TWO_THEIR_OID); + git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[2], &oid); } @@ -166,11 +166,11 @@ void test_index_reuc__read_byindex(void) cl_assert(reuc->mode[0] == 0100644); cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); - git_oid_fromstr(&oid, ONE_ANCESTOR_OID); + git_oid_fromstr(&oid, ONE_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[0], &oid); - git_oid_fromstr(&oid, ONE_OUR_OID); + git_oid_fromstr(&oid, ONE_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[1], &oid); - git_oid_fromstr(&oid, ONE_THEIR_OID); + git_oid_fromstr(&oid, ONE_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[2], &oid); cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 1)); @@ -179,11 +179,11 @@ void test_index_reuc__read_byindex(void) cl_assert(reuc->mode[0] == 0100644); cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); - git_oid_fromstr(&oid, TWO_ANCESTOR_OID); + git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[0], &oid); - git_oid_fromstr(&oid, TWO_OUR_OID); + git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[1], &oid); - git_oid_fromstr(&oid, TWO_THEIR_OID); + git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[2], &oid); } @@ -200,9 +200,9 @@ void test_index_reuc__updates_existing(void) index_caps |= GIT_INDEX_CAPABILITY_IGNORE_CASE; cl_git_pass(git_index_set_caps(repo_index, index_caps)); - git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID); - git_oid_fromstr(&our_oid, TWO_OUR_OID); - git_oid_fromstr(&their_oid, TWO_THEIR_OID); + git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID, GIT_OID_SHA1); + git_oid_fromstr(&our_oid, TWO_OUR_OID, GIT_OID_SHA1); + git_oid_fromstr(&their_oid, TWO_THEIR_OID, GIT_OID_SHA1); cl_git_pass(git_index_reuc_add(repo_index, "two.txt", 0100644, &ancestor_oid, @@ -219,11 +219,11 @@ void test_index_reuc__updates_existing(void) cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 0)); cl_assert_equal_s("TWO.txt", reuc->path); - git_oid_fromstr(&oid, TWO_OUR_OID); + git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[0], &oid); - git_oid_fromstr(&oid, TWO_THEIR_OID); + git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[1], &oid); - git_oid_fromstr(&oid, TWO_ANCESTOR_OID); + git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[2], &oid); } @@ -245,11 +245,11 @@ void test_index_reuc__remove(void) cl_assert(reuc->mode[0] == 0100644); cl_assert(reuc->mode[1] == 0100644); cl_assert(reuc->mode[2] == 0100644); - git_oid_fromstr(&oid, TWO_ANCESTOR_OID); + git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[0], &oid); - git_oid_fromstr(&oid, TWO_OUR_OID); + git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[1], &oid); - git_oid_fromstr(&oid, TWO_THEIR_OID); + git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1); cl_assert_equal_oid(&reuc->oid[2], &oid); } @@ -261,18 +261,18 @@ void test_index_reuc__write(void) git_index_clear(repo_index); /* Write out of order to ensure sorting is correct */ - git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID); - git_oid_fromstr(&our_oid, TWO_OUR_OID); - git_oid_fromstr(&their_oid, TWO_THEIR_OID); + git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID, GIT_OID_SHA1); + git_oid_fromstr(&our_oid, TWO_OUR_OID, GIT_OID_SHA1); + git_oid_fromstr(&their_oid, TWO_THEIR_OID, GIT_OID_SHA1); cl_git_pass(git_index_reuc_add(repo_index, "two.txt", 0100644, &ancestor_oid, 0100644, &our_oid, 0100644, &their_oid)); - git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID); - git_oid_fromstr(&our_oid, ONE_OUR_OID); - git_oid_fromstr(&their_oid, ONE_THEIR_OID); + git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID, GIT_OID_SHA1); + git_oid_fromstr(&our_oid, ONE_OUR_OID, GIT_OID_SHA1); + git_oid_fromstr(&their_oid, ONE_THEIR_OID, GIT_OID_SHA1); cl_git_pass(git_index_reuc_add(repo_index, "one.txt", 0100644, &ancestor_oid, diff --git a/tests/libgit2/index/tests.c b/tests/libgit2/index/tests.c index 205d12e5b..4df1e9878 100644 --- a/tests/libgit2/index/tests.c +++ b/tests/libgit2/index/tests.c @@ -259,7 +259,7 @@ void test_index_tests__add(void) * This has been generated by executing the following * $ echo "hey there" | git hash-object --stdin */ - cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); + cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1)); /* Add the new file to the index */ cl_git_pass(git_index_add_bypath(index, "test.txt")); @@ -304,7 +304,7 @@ void test_index_tests__add_frombuffer(void) * This has been generated by executing the following * $ echo "hey there" | git hash-object --stdin */ - cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); + cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1)); /* Add the new file to the index */ memset(&entry, 0x0, sizeof(git_index_entry)); @@ -447,7 +447,7 @@ void test_index_tests__add_frombuffer_reset_entry(void) * This has been generated by executing the following * $ echo "hey there" | git hash-object --stdin */ - cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); + cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1)); cl_git_pass(git_index_add_bypath(index, "test.txt")); @@ -511,7 +511,7 @@ void test_index_tests__add_issue_1397(void) * This has been generated by executing the following * $ git hash-object crlf_file.txt */ - cl_git_pass(git_oid_fromstr(&id1, "8312e0889a9cbab77c732b6bc39b51a683e3a318")); + cl_git_pass(git_oid_fromstr(&id1, "8312e0889a9cbab77c732b6bc39b51a683e3a318", GIT_OID_SHA1)); /* Make sure the initial SHA-1 is correct */ cl_assert((entry = git_index_get_bypath(index, "crlf_file.txt", 0)) != NULL); @@ -600,7 +600,7 @@ static void assert_add_fails(git_repository *repo, const char *fn) entry.path = fn; entry.mode = GIT_FILEMODE_BLOB; - cl_git_pass(git_oid_fromstr(&entry.id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391")); + cl_git_pass(git_oid_fromstr(&entry.id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", GIT_OID_SHA1)); cl_git_fail(git_index_add(index, &entry)); @@ -705,7 +705,7 @@ void test_index_tests__write_tree_invalid_unowned_index(void) cl_git_pass(git_index_new(&idx)); - cl_git_pass(git_oid_fromstr(&entry.id, "8312e0a89a9cbab77c732b6bc39b51a783e3a318")); + cl_git_pass(git_oid_fromstr(&entry.id, "8312e0a89a9cbab77c732b6bc39b51a783e3a318", GIT_OID_SHA1)); entry.path = "foo"; entry.mode = GIT_FILEMODE_BLOB; cl_git_pass(git_index_add(idx, &entry)); @@ -1147,12 +1147,12 @@ void test_index_tests__can_modify_while_iterating(void) * ensure that our iterator is backed by a snapshot and thus returns * the number of entries from when the iterator was created. */ - cl_git_pass(git_oid_fromstr(&new_entry.id, "8312e0a89a9cbab77c732b6bc39b51a783e3a318")); + cl_git_pass(git_oid_fromstr(&new_entry.id, "8312e0a89a9cbab77c732b6bc39b51a783e3a318", GIT_OID_SHA1)); new_entry.path = "newfile"; new_entry.mode = GIT_FILEMODE_BLOB; cl_git_pass(git_index_add(index, &new_entry)); - cl_git_pass(git_oid_fromstr(&new_entry.id, "4141414141414141414141414141414141414141")); + cl_git_pass(git_oid_fromstr(&new_entry.id, "4141414141414141414141414141414141414141", GIT_OID_SHA1)); new_entry.path = "Makefile"; new_entry.mode = GIT_FILEMODE_BLOB; cl_git_pass(git_index_add(index, &new_entry)); |
