@@ -151,7 +151,7 @@ static unsigned int input_offset, input_len;
151151static off_t consumed_bytes ;
152152static off_t max_input_size ;
153153static unsigned deepest_delta ;
154- static git_hash_ctx input_ctx ;
154+ static struct git_hash_ctx input_ctx ;
155155static uint32_t input_crc32 ;
156156static int input_fd , output_fd ;
157157static const char * curr_pack ;
@@ -301,7 +301,7 @@ static void flush(void)
301301 if (input_offset ) {
302302 if (output_fd >= 0 )
303303 write_or_die (output_fd , input_buffer , input_offset );
304- the_hash_algo -> update_fn (& input_ctx , input_buffer , input_offset );
304+ git_hash_update (& input_ctx , input_buffer , input_offset );
305305 memmove (input_buffer , input_buffer + input_offset , input_len );
306306 input_offset = 0 ;
307307 }
@@ -475,14 +475,14 @@ static void *unpack_entry_data(off_t offset, unsigned long size,
475475 int status ;
476476 git_zstream stream ;
477477 void * buf ;
478- git_hash_ctx c ;
478+ struct git_hash_ctx c ;
479479 char hdr [32 ];
480480 int hdrlen ;
481481
482482 if (!is_delta_type (type )) {
483483 hdrlen = format_object_header (hdr , sizeof (hdr ), type , size );
484484 the_hash_algo -> init_fn (& c );
485- the_hash_algo -> update_fn (& c , hdr , hdrlen );
485+ git_hash_update (& c , hdr , hdrlen );
486486 } else
487487 oid = NULL ;
488488 if (type == OBJ_BLOB && size > big_file_threshold )
@@ -502,7 +502,7 @@ static void *unpack_entry_data(off_t offset, unsigned long size,
502502 status = git_inflate (& stream , 0 );
503503 use (input_len - stream .avail_in );
504504 if (oid )
505- the_hash_algo -> update_fn (& c , last_out , stream .next_out - last_out );
505+ git_hash_update (& c , last_out , stream .next_out - last_out );
506506 if (buf == fixed_buf ) {
507507 stream .next_out = buf ;
508508 stream .avail_out = sizeof (fixed_buf );
@@ -512,7 +512,7 @@ static void *unpack_entry_data(off_t offset, unsigned long size,
512512 bad_object (offset , _ ("inflate returned %d" ), status );
513513 git_inflate_end (& stream );
514514 if (oid )
515- the_hash_algo -> final_oid_fn (oid , & c );
515+ git_hash_final_oid (oid , & c );
516516 return buf == fixed_buf ? NULL : buf ;
517517}
518518
@@ -1248,7 +1248,7 @@ static void parse_pack_objects(unsigned char *hash)
12481248 struct ofs_delta_entry * ofs_delta = ofs_deltas ;
12491249 struct object_id ref_delta_oid ;
12501250 struct stat st ;
1251- git_hash_ctx tmp_ctx ;
1251+ struct git_hash_ctx tmp_ctx ;
12521252
12531253 if (verbose )
12541254 progress = start_progress (
@@ -1286,9 +1286,8 @@ static void parse_pack_objects(unsigned char *hash)
12861286
12871287 /* Check pack integrity */
12881288 flush ();
1289- the_hash_algo -> init_fn (& tmp_ctx );
1290- the_hash_algo -> clone_fn (& tmp_ctx , & input_ctx );
1291- the_hash_algo -> final_fn (hash , & tmp_ctx );
1289+ git_hash_clone (& tmp_ctx , & input_ctx );
1290+ git_hash_final (hash , & tmp_ctx );
12921291 if (!hasheq (fill (the_hash_algo -> rawsz ), hash , the_repository -> hash_algo ))
12931292 die (_ ("pack is corrupted (SHA1 mismatch)" ));
12941293 use (the_hash_algo -> rawsz );
0 commit comments