summaryrefslogtreecommitdiff
path: root/examples/general.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-22 23:10:03 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-14 22:29:57 -0400
commitdbc4ac1c76827e954e0aa27afe8bb7e0b8993a93 (patch)
tree56f18a11bca8d17490a176cddf9e3756c2cebe91 /examples/general.c
parentf98dd5438f8d7bfd557b612fdf1605b1c3fb8eaf (diff)
downloadlibgit2-dbc4ac1c76827e954e0aa27afe8bb7e0b8993a93.tar.gz
oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE`
In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ` need to indicate that they're the size of _SHA1_ OIDs.
Diffstat (limited to 'examples/general.c')
-rw-r--r--examples/general.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/general.c b/examples/general.c
index 2127ec0e1..9e678f887 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -129,7 +129,7 @@ int lg2_general(git_repository *repo, int argc, char** argv)
*/
static void oid_parsing(git_oid *oid)
{
- char out[GIT_OID_HEXSZ+1];
+ char out[GIT_OID_SHA1_HEXSIZE+1];
char hex[] = "4a202b346bb0fb0db7eff3cffeb3c70babbd2045";
printf("*Hex to Raw*\n");
@@ -152,7 +152,7 @@ static void oid_parsing(git_oid *oid)
* char hex value.
*/
printf("\n*Raw to Hex*\n");
- out[GIT_OID_HEXSZ] = '\0';
+ out[GIT_OID_SHA1_HEXSIZE] = '\0';
/**
* If you have a oid, you can easily get the hex value of the SHA as well.
@@ -173,7 +173,7 @@ static void oid_parsing(git_oid *oid)
*/
static void object_database(git_repository *repo, git_oid *oid)
{
- char oid_hex[GIT_OID_HEXSZ+1] = { 0 };
+ char oid_hex[GIT_OID_SHA1_HEXSIZE+1] = { 0 };
const unsigned char *data;
const char *str_type;
int error;
@@ -266,7 +266,7 @@ static void commit_writing(git_repository *repo)
git_tree *tree;
git_commit *parent;
git_signature *author, *committer;
- char oid_hex[GIT_OID_HEXSZ+1] = { 0 };
+ char oid_hex[GIT_OID_SHA1_HEXSIZE+1] = { 0 };
printf("\n*Commit Writing*\n");
@@ -345,7 +345,7 @@ static void commit_parsing(git_repository *repo)
const git_signature *author, *cmtter;
git_commit *commit, *parent;
git_oid oid;
- char oid_hex[GIT_OID_HEXSZ+1];
+ char oid_hex[GIT_OID_SHA1_HEXSIZE+1];
const char *message;
unsigned int parents, p;
int error;
@@ -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_HEXSZ+1] = GIT_OID_HEX_ZERO;
+ char oid_hex[GIT_OID_SHA1_HEXSIZE+1] = GIT_OID_HEX_ZERO;
const char *refname;
refname = ref_list.strings[i];