@@ -129,7 +129,7 @@ int lg2_general(git_repository *repo, int argc, char** argv)
129129 */
130130static void oid_parsing (git_oid * oid )
131131{
132- char out [GIT_OID_HEXSZ + 1 ];
132+ char out [GIT_OID_SHA1_HEXSIZE + 1 ];
133133 char hex [] = "4a202b346bb0fb0db7eff3cffeb3c70babbd2045" ;
134134
135135 printf ("*Hex to Raw*\n" );
@@ -142,7 +142,7 @@ static void oid_parsing(git_oid *oid)
142142 * this throughout the example for storing the value of the current SHA
143143 * key we're working with.
144144 */
145- git_oid_fromstr (oid , hex );
145+ git_oid_fromstr (oid , hex , GIT_OID_SHA1 );
146146
147147 /*
148148 * Once we've converted the string into the oid value, we can get the raw
@@ -152,7 +152,7 @@ static void oid_parsing(git_oid *oid)
152152 * char hex value.
153153 */
154154 printf ("\n*Raw to Hex*\n" );
155- out [GIT_OID_HEXSZ ] = '\0' ;
155+ out [GIT_OID_SHA1_HEXSIZE ] = '\0' ;
156156
157157 /**
158158 * 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)
173173 */
174174static void object_database (git_repository * repo , git_oid * oid )
175175{
176- char oid_hex [GIT_OID_HEXSZ + 1 ] = { 0 };
176+ char oid_hex [GIT_OID_SHA1_HEXSIZE + 1 ] = { 0 };
177177 const unsigned char * data ;
178178 const char * str_type ;
179179 int error ;
@@ -266,7 +266,7 @@ static void commit_writing(git_repository *repo)
266266 git_tree * tree ;
267267 git_commit * parent ;
268268 git_signature * author , * committer ;
269- char oid_hex [GIT_OID_HEXSZ + 1 ] = { 0 };
269+ char oid_hex [GIT_OID_SHA1_HEXSIZE + 1 ] = { 0 };
270270
271271 printf ("\n*Commit Writing*\n" );
272272
@@ -287,9 +287,9 @@ static void commit_writing(git_repository *repo)
287287 * parents. Here we're creating oid objects to create the commit with,
288288 * but you can also use
289289 */
290- git_oid_fromstr (& tree_id , "f60079018b664e4e79329a7ef9559c8d9e0378d1" );
290+ git_oid_fromstr (& tree_id , "f60079018b664e4e79329a7ef9559c8d9e0378d1" , GIT_OID_SHA1 );
291291 git_tree_lookup (& tree , repo , & tree_id );
292- git_oid_fromstr (& parent_id , "5b5b025afb0b4c913b4c338a42934a3863bf3644" );
292+ git_oid_fromstr (& parent_id , "5b5b025afb0b4c913b4c338a42934a3863bf3644" , GIT_OID_SHA1 );
293293 git_commit_lookup (& parent , repo , & parent_id );
294294
295295 /**
@@ -345,15 +345,15 @@ static void commit_parsing(git_repository *repo)
345345 const git_signature * author , * cmtter ;
346346 git_commit * commit , * parent ;
347347 git_oid oid ;
348- char oid_hex [GIT_OID_HEXSZ + 1 ];
348+ char oid_hex [GIT_OID_SHA1_HEXSIZE + 1 ];
349349 const char * message ;
350350 unsigned int parents , p ;
351351 int error ;
352352 time_t time ;
353353
354354 printf ("\n*Commit Parsing*\n" );
355355
356- git_oid_fromstr (& oid , "8496071c1b46c854b31185ea97743be6a8774479" );
356+ git_oid_fromstr (& oid , "8496071c1b46c854b31185ea97743be6a8774479" , GIT_OID_SHA1 );
357357
358358 error = git_commit_lookup (& commit , repo , & oid );
359359 check_error (error , "looking up commit" );
@@ -422,7 +422,7 @@ static void tag_parsing(git_repository *repo)
422422 * We create an oid for the tag object if we know the SHA and look it up
423423 * the same way that we would a commit (or any other object).
424424 */
425- git_oid_fromstr (& oid , "b25fa35b38051e4ae45d4222e795f9df2e43f1d1" );
425+ git_oid_fromstr (& oid , "b25fa35b38051e4ae45d4222e795f9df2e43f1d1" , GIT_OID_SHA1 );
426426
427427 error = git_tag_lookup (& tag , repo , & oid );
428428 check_error (error , "looking up tag" );
@@ -470,7 +470,7 @@ static void tree_parsing(git_repository *repo)
470470 /**
471471 * Create the oid and lookup the tree object just like the other objects.
472472 */
473- git_oid_fromstr (& oid , "f60079018b664e4e79329a7ef9559c8d9e0378d1" );
473+ git_oid_fromstr (& oid , "f60079018b664e4e79329a7ef9559c8d9e0378d1" , GIT_OID_SHA1 );
474474 git_tree_lookup (& tree , repo , & oid );
475475
476476 /**
@@ -524,7 +524,7 @@ static void blob_parsing(git_repository *repo)
524524
525525 printf ("\n*Blob Parsing*\n" );
526526
527- git_oid_fromstr (& oid , "1385f264afb75a56a5bec74243be9b367ba4ca08" );
527+ git_oid_fromstr (& oid , "1385f264afb75a56a5bec74243be9b367ba4ca08" , GIT_OID_SHA1 );
528528 git_blob_lookup (& blob , repo , & oid );
529529
530530 /**
@@ -566,7 +566,7 @@ static void revwalking(git_repository *repo)
566566
567567 printf ("\n*Revwalking*\n" );
568568
569- git_oid_fromstr (& oid , "5b5b025afb0b4c913b4c338a42934a3863bf3644" );
569+ git_oid_fromstr (& oid , "5b5b025afb0b4c913b4c338a42934a3863bf3644" , GIT_OID_SHA1 );
570570
571571 /**
572572 * To use the revwalker, create a new walker, tell it how you want to sort
@@ -679,7 +679,7 @@ static void reference_listing(git_repository *repo)
679679
680680 for (i = 0 ; i < ref_list .count ; ++ i ) {
681681 git_reference * ref ;
682- char oid_hex [GIT_OID_HEXSZ + 1 ] = GIT_OID_HEX_ZERO ;
682+ char oid_hex [GIT_OID_SHA1_HEXSIZE + 1 ] = GIT_OID_SHA1_HEXZERO ;
683683 const char * refname ;
684684
685685 refname = ref_list .strings [i ];
0 commit comments