diff options
| -rw-r--r-- | examples/general.c | 2 | ||||
| -rw-r--r-- | include/git2/common.h | 5 | ||||
| -rw-r--r-- | include/git2/oid.h | 10 | ||||
| -rw-r--r-- | src/libgit2/merge.c | 2 | ||||
| -rw-r--r-- | src/libgit2/object.c | 4 | ||||
| -rw-r--r-- | src/libgit2/odb.c | 8 | ||||
| -rw-r--r-- | src/libgit2/odb_pack.c | 2 | ||||
| -rw-r--r-- | src/libgit2/refdb_fs.c | 2 | ||||
| -rw-r--r-- | src/libgit2/reflog.c | 4 | ||||
| -rw-r--r-- | src/libgit2/remote.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/blame/getters.c | 10 | ||||
| -rw-r--r-- | tests/libgit2/core/oidmap.c | 12 | ||||
| -rw-r--r-- | tests/libgit2/iterator/workdir.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/object/tree/update.c | 32 | ||||
| -rw-r--r-- | tests/libgit2/object/tree/write.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/odb/backend/simple.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/odb/mixed.c | 4 | ||||
| -rw-r--r-- | tests/libgit2/online/clone.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/online/push_util.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/refs/branches/delete.c | 4 | ||||
| -rw-r--r-- | tests/libgit2/refs/reflog/drop.c | 4 | ||||
| -rw-r--r-- | tests/libgit2/refs/reflog/messages.c | 6 | ||||
| -rw-r--r-- | tests/libgit2/refs/reflog/reflog.c | 2 | ||||
| -rw-r--r-- | tests/libgit2/status/worktree.c | 2 |
24 files changed, 65 insertions, 62 deletions
diff --git a/examples/general.c b/examples/general.c index 9e678f887..6b25dd023 100644 --- a/examples/general.c +++ b/examples/general.c @@ -679,7 +679,7 @@ static void reference_listing(git_repository *repo) for (i = 0; i < ref_list.count; ++i) { git_reference *ref; - char oid_hex[GIT_OID_SHA1_HEXSIZE+1] = GIT_OID_HEX_ZERO; + char oid_hex[GIT_OID_SHA1_HEXSIZE+1] = GIT_OID_SHA1_HEXZERO; const char *refname; refname = ref_list.strings[i]; diff --git a/include/git2/common.h b/include/git2/common.h index c3e3e7b4e..ccf66334a 100644 --- a/include/git2/common.h +++ b/include/git2/common.h @@ -106,11 +106,6 @@ GIT_BEGIN_DECL #define GIT_PATH_MAX 4096 /** - * The string representation of the null object ID. - */ -#define GIT_OID_HEX_ZERO "0000000000000000000000000000000000000000" - -/** * Return the version of the libgit2 library * being currently used. * diff --git a/include/git2/oid.h b/include/git2/oid.h index 0d0f05489..3dedae85e 100644 --- a/include/git2/oid.h +++ b/include/git2/oid.h @@ -36,6 +36,16 @@ typedef struct git_oid { } git_oid; /** + * The binary representation of the null object ID. + */ +#define GIT_OID_SHA1_ZERO { { 0 } } + +/** + * The string representation of the null object ID. + */ +#define GIT_OID_SHA1_HEXZERO "0000000000000000000000000000000000000000" + +/** * Parse a hex formatted object id into a git_oid. * * @param out oid structure the result is written into. diff --git a/src/libgit2/merge.c b/src/libgit2/merge.c index 01f60abc5..e4db2629c 100644 --- a/src/libgit2/merge.c +++ b/src/libgit2/merge.c @@ -1061,7 +1061,7 @@ static int index_entry_similarity_calc( const git_merge_options *opts) { git_blob *blob; - git_diff_file diff_file = {{{0}}}; + git_diff_file diff_file = { GIT_OID_SHA1_ZERO }; git_object_size_t blobsize; int error; diff --git a/src/libgit2/object.c b/src/libgit2/object.c index c28093970..d43f3f0b0 100644 --- a/src/libgit2/object.c +++ b/src/libgit2/object.c @@ -230,7 +230,7 @@ int git_object_lookup_prefix( error = git_odb_read(&odb_obj, odb, id); } } else { - git_oid short_oid = {{ 0 }}; + git_oid short_oid = GIT_OID_SHA1_ZERO; git_oid__cpy_prefix(&short_oid, id, len); @@ -502,7 +502,7 @@ static int git_object__short_id(git_str *out, const git_object *obj) { git_repository *repo; int len = GIT_ABBREV_DEFAULT, error; - git_oid id = {{0}}; + git_oid id = GIT_OID_SHA1_ZERO; git_odb *odb; GIT_ASSERT_ARG(out); diff --git a/src/libgit2/odb.c b/src/libgit2/odb.c index 43a64fc80..fed103ebb 100644 --- a/src/libgit2/odb.c +++ b/src/libgit2/odb.c @@ -914,7 +914,7 @@ static int odb_exists_prefix_1(git_oid *out, git_odb *db, { size_t i; int error = GIT_ENOTFOUND, num_found = 0; - git_oid last_found = {{0}}, found; + git_oid last_found = GIT_OID_SHA1_ZERO, found; if ((error = git_mutex_lock(&db->lock)) < 0) { git_error_set(GIT_ERROR_ODB, "failed to acquire the odb lock"); @@ -965,7 +965,7 @@ int git_odb_exists_prefix( git_oid *out, git_odb *db, const git_oid *short_id, size_t len) { int error; - git_oid key = {{0}}; + git_oid key = GIT_OID_SHA1_ZERO; GIT_ASSERT_ARG(db); GIT_ASSERT_ARG(short_id); @@ -1305,7 +1305,7 @@ static int read_prefix_1(git_odb_object **out, git_odb *db, { size_t i; int error = 0; - git_oid found_full_oid = {{0}}; + git_oid found_full_oid = GIT_OID_SHA1_ZERO; git_rawobj raw = {0}; void *data = NULL; bool found = false; @@ -1391,7 +1391,7 @@ out: int git_odb_read_prefix( git_odb_object **out, git_odb *db, const git_oid *short_id, size_t len) { - git_oid key = {{0}}; + git_oid key = GIT_OID_SHA1_ZERO; int error; GIT_ASSERT_ARG(out); diff --git a/src/libgit2/odb_pack.c b/src/libgit2/odb_pack.c index 2401e9578..49a655b44 100644 --- a/src/libgit2/odb_pack.c +++ b/src/libgit2/odb_pack.c @@ -307,7 +307,7 @@ static int pack_entry_find_prefix( { int error; size_t i; - git_oid found_full_oid = {{0}}; + git_oid found_full_oid = GIT_OID_SHA1_ZERO; bool found = false; struct git_pack_file *last_found = backend->last_found, *p; git_midx_entry midx_entry; diff --git a/src/libgit2/refdb_fs.c b/src/libgit2/refdb_fs.c index d7b0da174..0d0656a63 100644 --- a/src/libgit2/refdb_fs.c +++ b/src/libgit2/refdb_fs.c @@ -2192,7 +2192,7 @@ success: static int reflog_append(refdb_fs_backend *backend, const git_reference *ref, const git_oid *old, const git_oid *new, const git_signature *who, const char *message) { int error, is_symbolic, open_flags; - git_oid old_id = {{0}}, new_id = {{0}}; + git_oid old_id = GIT_OID_SHA1_ZERO, new_id = GIT_OID_SHA1_ZERO; git_str buf = GIT_STR_INIT, path = GIT_STR_INIT; git_repository *repo = backend->repo; diff --git a/src/libgit2/reflog.c b/src/libgit2/reflog.c index 1e9c0d4f1..ca6d53808 100644 --- a/src/libgit2/reflog.c +++ b/src/libgit2/reflog.c @@ -104,7 +104,7 @@ int git_reflog_append(git_reflog *reflog, const git_oid *new_oid, const git_sign previous = git_reflog_entry_byindex(reflog, 0); if (previous == NULL) - git_oid_fromstr(&entry->oid_old, GIT_OID_HEX_ZERO); + git_oid_fromstr(&entry->oid_old, GIT_OID_SHA1_HEXZERO); else git_oid_cpy(&entry->oid_old, &previous->oid_cur); @@ -219,7 +219,7 @@ int git_reflog_drop(git_reflog *reflog, size_t idx, int rewrite_previous_entry) /* If the oldest entry has just been removed... */ if (idx == entrycount - 1) { /* ...clear the oid_old member of the "new" oldest entry */ - if (git_oid_fromstr(&entry->oid_old, GIT_OID_HEX_ZERO) < 0) + if (git_oid_fromstr(&entry->oid_old, GIT_OID_SHA1_HEXZERO) < 0) return -1; return 0; diff --git a/src/libgit2/remote.c b/src/libgit2/remote.c index 3d0593712..61805596f 100644 --- a/src/libgit2/remote.c +++ b/src/libgit2/remote.c @@ -1622,7 +1622,7 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks) const git_refspec *spec; const char *refname; int error; - git_oid zero_id = {{ 0 }}; + git_oid zero_id = GIT_OID_SHA1_ZERO; if (callbacks) GIT_ERROR_CHECK_VERSION(callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); diff --git a/tests/libgit2/blame/getters.c b/tests/libgit2/blame/getters.c index 66eaeecf9..c160cd383 100644 --- a/tests/libgit2/blame/getters.c +++ b/tests/libgit2/blame/getters.c @@ -10,11 +10,11 @@ void test_blame_getters__initialize(void) git_blame_options opts = GIT_BLAME_OPTIONS_INIT; git_blame_hunk hunks[] = { - { 3, {{0}}, 1, NULL, {{0}}, "a", 0}, - { 3, {{0}}, 4, NULL, {{0}}, "b", 0}, - { 3, {{0}}, 7, NULL, {{0}}, "c", 0}, - { 3, {{0}}, 10, NULL, {{0}}, "d", 0}, - { 3, {{0}}, 13, NULL, {{0}}, "e", 0}, + { 3, GIT_OID_SHA1_ZERO, 1, NULL, GIT_OID_SHA1_ZERO, "a", 0}, + { 3, GIT_OID_SHA1_ZERO, 4, NULL, GIT_OID_SHA1_ZERO, "b", 0}, + { 3, GIT_OID_SHA1_ZERO, 7, NULL, GIT_OID_SHA1_ZERO, "c", 0}, + { 3, GIT_OID_SHA1_ZERO, 10, NULL, GIT_OID_SHA1_ZERO, "d", 0}, + { 3, GIT_OID_SHA1_ZERO, 13, NULL, GIT_OID_SHA1_ZERO, "e", 0}, }; g_blame = git_blame__alloc(NULL, opts, ""); diff --git a/tests/libgit2/core/oidmap.c b/tests/libgit2/core/oidmap.c index 6854e3432..7f549fc18 100644 --- a/tests/libgit2/core/oidmap.c +++ b/tests/libgit2/core/oidmap.c @@ -93,9 +93,9 @@ void test_core_oidmap__get_fails_with_nonexisting_key(void) void test_core_oidmap__setting_oid_persists(void) { git_oid oids[] = { - {{ 0x01 }}, - {{ 0x02 }}, - {{ 0x03 }} + { { 0x01 }}, + { { 0x02 }}, + { { 0x03 }} }; cl_git_pass(git_oidmap_set(g_map, &oids[0], "one")); @@ -110,9 +110,9 @@ void test_core_oidmap__setting_oid_persists(void) void test_core_oidmap__setting_existing_key_updates(void) { git_oid oids[] = { - {{ 0x01 }}, - {{ 0x02 }}, - {{ 0x03 }} + { { 0x01 }}, + { { 0x02 }}, + { { 0x03 }} }; cl_git_pass(git_oidmap_set(g_map, &oids[0], "one")); diff --git a/tests/libgit2/iterator/workdir.c b/tests/libgit2/iterator/workdir.c index 86b847cab..112cd9a4e 100644 --- a/tests/libgit2/iterator/workdir.c +++ b/tests/libgit2/iterator/workdir.c @@ -1481,7 +1481,7 @@ void test_iterator_workdir__hash_when_requested(void) git_iterator *iter; const git_index_entry *entry; git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; - git_oid expected_id = {{0}}; + git_oid expected_id = GIT_OID_SHA1_ZERO; size_t i; struct merge_index_entry expected[] = { diff --git a/tests/libgit2/object/tree/update.c b/tests/libgit2/object/tree/update.c index 41b50f3e9..4e1191db1 100644 --- a/tests/libgit2/object/tree/update.c +++ b/tests/libgit2/object/tree/update.c @@ -21,7 +21,7 @@ void test_object_tree_update__remove_blob(void) const char *path = "README"; git_tree_update updates[] = { - { GIT_TREE_UPDATE_REMOVE, {{0}}, GIT_FILEMODE_BLOB /* ignored */, path}, + { GIT_TREE_UPDATE_REMOVE, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB /* ignored */, path}, }; cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")); @@ -50,7 +50,7 @@ void test_object_tree_update__remove_blob_deeper(void) const char *path = "subdir/README"; git_tree_update updates[] = { - { GIT_TREE_UPDATE_REMOVE, {{0}}, GIT_FILEMODE_BLOB /* ignored */, path}, + { GIT_TREE_UPDATE_REMOVE, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB /* ignored */, path}, }; cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")); @@ -80,8 +80,8 @@ void test_object_tree_update__remove_all_entries(void) const char *path2 = "subdir/subdir2/new.txt"; git_tree_update updates[] = { - { GIT_TREE_UPDATE_REMOVE, {{0}}, GIT_FILEMODE_BLOB /* ignored */, path1}, - { GIT_TREE_UPDATE_REMOVE, {{0}}, GIT_FILEMODE_BLOB /* ignored */, path2}, + { GIT_TREE_UPDATE_REMOVE, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB /* ignored */, path1}, + { GIT_TREE_UPDATE_REMOVE, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB /* ignored */, path2}, }; cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")); @@ -112,7 +112,7 @@ void test_object_tree_update__replace_blob(void) git_index_entry entry = { {0} }; git_tree_update updates[] = { - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, path}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, path}, }; cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")); @@ -153,9 +153,9 @@ void test_object_tree_update__add_blobs(void) }; git_tree_update updates[] = { - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, paths[0]}, - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, paths[1]}, - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, paths[2]}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, paths[0]}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, paths[1]}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, paths[2]}, }; cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")); @@ -210,9 +210,9 @@ void test_object_tree_update__add_blobs_unsorted(void) }; git_tree_update updates[] = { - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, paths[0]}, - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, paths[1]}, - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, paths[2]}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, paths[0]}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, paths[1]}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, paths[2]}, }; cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b")); @@ -258,8 +258,8 @@ void test_object_tree_update__add_conflict(void) int i; git_oid tree_updater_id; git_tree_update updates[] = { - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, "a/dir/blob"}, - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, "a/dir"}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, "a/dir/blob"}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, "a/dir"}, }; for (i = 0; i < 2; i++) { @@ -274,8 +274,8 @@ void test_object_tree_update__add_conflict2(void) int i; git_oid tree_updater_id; git_tree_update updates[] = { - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_BLOB, "a/dir/blob"}, - { GIT_TREE_UPDATE_UPSERT, {{0}}, GIT_FILEMODE_TREE, "a/dir/blob"}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, "a/dir/blob"}, + { GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_TREE, "a/dir/blob"}, }; for (i = 0; i < 2; i++) { @@ -290,7 +290,7 @@ void test_object_tree_update__remove_invalid_submodule(void) git_tree *baseline; git_oid updated_tree_id, baseline_id; git_tree_update updates[] = { - {GIT_TREE_UPDATE_REMOVE, {{0}}, GIT_FILEMODE_BLOB, "submodule"}, + {GIT_TREE_UPDATE_REMOVE, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, "submodule"}, }; /* This tree contains a submodule with an all-zero commit for a submodule named 'submodule' */ diff --git a/tests/libgit2/object/tree/write.c b/tests/libgit2/object/tree/write.c index a4ceb35b6..5088a9680 100644 --- a/tests/libgit2/object/tree/write.c +++ b/tests/libgit2/object/tree/write.c @@ -516,7 +516,7 @@ void test_object_tree_write__object_validity(void) void test_object_tree_write__invalid_null_oid(void) { git_treebuilder *bld; - git_oid null_oid = {{0}}; + git_oid null_oid = GIT_OID_SHA1_ZERO; cl_git_pass(git_treebuilder_new(&bld, g_repo, NULL)); cl_git_fail(git_treebuilder_insert(NULL, bld, "null_oid_file", &null_oid, GIT_FILEMODE_BLOB)); diff --git a/tests/libgit2/odb/backend/simple.c b/tests/libgit2/odb/backend/simple.c index 6c9293ac0..d2051f821 100644 --- a/tests/libgit2/odb/backend/simple.c +++ b/tests/libgit2/odb/backend/simple.c @@ -237,7 +237,7 @@ void test_odb_backend_simple__null_oid_is_ignored(void) { "0000000000000000000000000000000000000000", "null oid content" }, { NULL, NULL } }; - git_oid null_oid = {{0}}; + git_oid null_oid = GIT_OID_SHA1_ZERO; git_odb_object *obj; setup_backend(objs); diff --git a/tests/libgit2/odb/mixed.c b/tests/libgit2/odb/mixed.c index cbab8e362..70eda8237 100644 --- a/tests/libgit2/odb/mixed.c +++ b/tests/libgit2/odb/mixed.c @@ -186,7 +186,7 @@ static void assert_found_objects(git_odb_expand_id *ids) num = ARRAY_SIZE(expand_id_test_data); for (i = 0; i < num; i++) { - git_oid expected_id = {{0}}; + git_oid expected_id = GIT_OID_SHA1_ZERO; size_t expected_len = 0; git_object_t expected_type = 0; @@ -204,7 +204,7 @@ static void assert_found_objects(git_odb_expand_id *ids) static void assert_notfound_objects(git_odb_expand_id *ids) { - git_oid expected_id = {{0}}; + git_oid expected_id = GIT_OID_SHA1_ZERO; size_t num, i; num = ARRAY_SIZE(expand_id_test_data); diff --git a/tests/libgit2/online/clone.c b/tests/libgit2/online/clone.c index dfaee0e85..a9e98dfca 100644 --- a/tests/libgit2/online/clone.c +++ b/tests/libgit2/online/clone.c @@ -629,7 +629,7 @@ void test_online_clone__ssh_cannot_change_username(void) static int ssh_certificate_check(git_cert *cert, int valid, const char *host, void *payload) { git_cert_hostkey *key; - git_oid expected = {{0}}, actual = {{0}}; + git_oid expected = GIT_OID_SHA1_ZERO, actual = GIT_OID_SHA1_ZERO; GIT_UNUSED(valid); GIT_UNUSED(payload); diff --git a/tests/libgit2/online/push_util.c b/tests/libgit2/online/push_util.c index cd1831d4c..94919e9b2 100644 --- a/tests/libgit2/online/push_util.c +++ b/tests/libgit2/online/push_util.c @@ -2,8 +2,6 @@ #include "vector.h" #include "push_util.h" -const git_oid OID_ZERO = {{ 0 }}; - void updated_tip_free(updated_tip *t) { git__free(t->name); diff --git a/tests/libgit2/refs/branches/delete.c b/tests/libgit2/refs/branches/delete.c index 27995f9e2..2c2eae272 100644 --- a/tests/libgit2/refs/branches/delete.c +++ b/tests/libgit2/refs/branches/delete.c @@ -119,7 +119,7 @@ void test_refs_branches_delete__removes_reflog(void) { git_reference *branch; git_reflog *log; - git_oid oidzero = {{0}}; + git_oid oidzero = GIT_OID_SHA1_ZERO; git_signature *sig; /* Ensure the reflog has at least one entry */ @@ -150,7 +150,7 @@ void test_refs_branches_delete__removes_empty_folders(void) git_reference *branch; git_reflog *log; - git_oid oidzero = {{0}}; + git_oid oidzero = GIT_OID_SHA1_ZERO; git_signature *sig; git_str ref_folder = GIT_STR_INIT; diff --git a/tests/libgit2/refs/reflog/drop.c b/tests/libgit2/refs/reflog/drop.c index 916bd9933..2d7193380 100644 --- a/tests/libgit2/refs/reflog/drop.c +++ b/tests/libgit2/refs/reflog/drop.c @@ -70,7 +70,7 @@ void test_refs_reflog_drop__can_drop_the_oldest_entry(void) cl_assert_equal_sz(entrycount - 1, git_reflog_entrycount(g_reflog)); entry = git_reflog_entry_byindex(g_reflog, entrycount - 2); - cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_HEX_ZERO) != 0); + cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_SHA1_HEXZERO) != 0); } void test_refs_reflog_drop__can_drop_the_oldest_entry_and_rewrite_the_log_history(void) @@ -83,7 +83,7 @@ void test_refs_reflog_drop__can_drop_the_oldest_entry_and_rewrite_the_log_histor cl_assert_equal_sz(entrycount - 1, git_reflog_entrycount(g_reflog)); entry = git_reflog_entry_byindex(g_reflog, entrycount - 2); - cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_HEX_ZERO) == 0); + cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_SHA1_HEXZERO) == 0); } void test_refs_reflog_drop__can_drop_all_the_entries(void) diff --git a/tests/libgit2/refs/reflog/messages.c b/tests/libgit2/refs/reflog/messages.c index ed183d2f2..9bff6647d 100644 --- a/tests/libgit2/refs/reflog/messages.c +++ b/tests/libgit2/refs/reflog/messages.c @@ -264,7 +264,7 @@ void test_refs_reflog_messages__creating_a_direct_reference(void) cl_assert_equal_sz(1, git_reflog_entrycount(reflog)); entry = git_reflog_entry_byindex(reflog, 0); - cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_HEX_ZERO) == 0); + cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_SHA1_HEXZERO) == 0); cl_assert_equal_oid(&id, &entry->oid_cur); cl_assert_equal_s(message, entry->msg); @@ -352,7 +352,7 @@ void test_refs_reflog_messages__creating_branches_default_messages(void) cl_git_pass(git_str_printf(&buf, "branch: Created from %s", git_oid_tostr_s(git_commit_id(target)))); cl_reflog_check_entry(g_repo, "refs/heads/" NEW_BRANCH_NAME, 0, - GIT_OID_HEX_ZERO, + GIT_OID_SHA1_HEXZERO, git_oid_tostr_s(git_commit_id(target)), g_email, git_str_cstr(&buf)); @@ -362,7 +362,7 @@ void test_refs_reflog_messages__creating_branches_default_messages(void) cl_git_pass(git_branch_create_from_annotated(&branch2, g_repo, NEW_BRANCH_NAME, annotated, true)); cl_reflog_check_entry(g_repo, "refs/heads/" NEW_BRANCH_NAME, 0, - GIT_OID_HEX_ZERO, + GIT_OID_SHA1_HEXZERO, git_oid_tostr_s(git_commit_id(target)), g_email, "branch: Created from e90810b8df3"); diff --git a/tests/libgit2/refs/reflog/reflog.c b/tests/libgit2/refs/reflog/reflog.c index 32ce7ffb7..2674f039d 100644 --- a/tests/libgit2/refs/reflog/reflog.c +++ b/tests/libgit2/refs/reflog/reflog.c @@ -52,7 +52,7 @@ static void assert_appends(const git_signature *committer, const git_oid *oid) /* The first one was the creation of the branch */ entry = git_reflog_entry_byindex(reflog, 2); - cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_HEX_ZERO) == 0); + cl_assert(git_oid_streq(&entry->oid_old, GIT_OID_SHA1_HEXZERO) == 0); entry = git_reflog_entry_byindex(reflog, 1); assert_signature(committer, entry->committer); diff --git a/tests/libgit2/status/worktree.c b/tests/libgit2/status/worktree.c index 00c6ec2d5..5bd3987c1 100644 --- a/tests/libgit2/status/worktree.c +++ b/tests/libgit2/status/worktree.c @@ -744,7 +744,7 @@ void test_status_worktree__conflict_has_no_oid(void) git_index_entry entry = {{0}}; git_status_list *statuslist; const git_status_entry *status; - git_oid zero_id = {{0}}; + git_oid zero_id = GIT_OID_SHA1_ZERO; entry.mode = 0100644; entry.path = "modified_file"; |
