summaryrefslogtreecommitdiff
path: root/src/libgit2/object.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-17 13:40:37 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-14 22:29:57 -0400
commit0acaf3a8eb7c3276b7864df8f5588c7007b38f35 (patch)
treea5f6a678339651be6c9681f84a489950d34b9fb2 /src/libgit2/object.c
parentdbc4ac1c76827e954e0aa27afe8bb7e0b8993a93 (diff)
downloadlibgit2-0acaf3a8eb7c3276b7864df8f5588c7007b38f35.tar.gz
oid: define GIT_OID_SHA1_ZERO
Callers should not assume the layout of the oid structure; provide them a macro that defines the null / zero sha1 object id.
Diffstat (limited to 'src/libgit2/object.c')
-rw-r--r--src/libgit2/object.c4
1 files changed, 2 insertions, 2 deletions
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);