@@ -785,7 +785,7 @@ static int check_collison(struct object_entry *entry)
785785
786786static  void  sha1_object (const  void  * data , struct  object_entry  * obj_entry ,
787787			unsigned long  size , enum  object_type  type ,
788- 			const  unsigned  char   * sha1 )
788+ 			const  struct   object_id   * oid )
789789{
790790	void  * new_data  =  NULL ;
791791	int  collision_test_needed  =  0 ;
@@ -794,7 +794,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
794794
795795	if  (startup_info -> have_repository ) {
796796		read_lock ();
797- 		collision_test_needed  =  has_sha1_file_with_flags (sha1 , HAS_SHA1_QUICK );
797+ 		collision_test_needed  =  has_sha1_file_with_flags (oid -> hash , HAS_SHA1_QUICK );
798798		read_unlock ();
799799	}
800800
@@ -809,31 +809,31 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
809809		enum  object_type  has_type ;
810810		unsigned long  has_size ;
811811		read_lock ();
812- 		has_type  =  sha1_object_info (sha1 , & has_size );
812+ 		has_type  =  sha1_object_info (oid -> hash , & has_size );
813813		if  (has_type  <  0 )
814- 			die (_ ("cannot read existing object info %s" ), sha1_to_hex ( sha1 ));
814+ 			die (_ ("cannot read existing object info %s" ), oid_to_hex ( oid ));
815815		if  (has_type  !=  type  ||  has_size  !=  size )
816- 			die (_ ("SHA1 COLLISION FOUND WITH %s !" ), sha1_to_hex ( sha1 ));
817- 		has_data  =  read_sha1_file (sha1 , & has_type , & has_size );
816+ 			die (_ ("SHA1 COLLISION FOUND WITH %s !" ), oid_to_hex ( oid ));
817+ 		has_data  =  read_sha1_file (oid -> hash , & has_type , & has_size );
818818		read_unlock ();
819819		if  (!data )
820820			data  =  new_data  =  get_data_from_pack (obj_entry );
821821		if  (!has_data )
822- 			die (_ ("cannot read existing object %s" ), sha1_to_hex ( sha1 ));
822+ 			die (_ ("cannot read existing object %s" ), oid_to_hex ( oid ));
823823		if  (size  !=  has_size  ||  type  !=  has_type  || 
824824		    memcmp (data , has_data , size ) !=  0 )
825- 			die (_ ("SHA1 COLLISION FOUND WITH %s !" ), sha1_to_hex ( sha1 ));
825+ 			die (_ ("SHA1 COLLISION FOUND WITH %s !" ), oid_to_hex ( oid ));
826826		free (has_data );
827827	}
828828
829829	if  (strict ) {
830830		read_lock ();
831831		if  (type  ==  OBJ_BLOB ) {
832- 			struct  blob  * blob  =  lookup_blob (sha1 );
832+ 			struct  blob  * blob  =  lookup_blob (oid -> hash );
833833			if  (blob )
834834				blob -> object .flags  |= FLAG_CHECKED ;
835835			else 
836- 				die (_ ("invalid blob object %s" ), sha1_to_hex ( sha1 ));
836+ 				die (_ ("invalid blob object %s" ), oid_to_hex ( oid ));
837837		} else  {
838838			struct  object  * obj ;
839839			int  eaten ;
@@ -845,7 +845,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
845845			 * we do not need to free the memory here, as the 
846846			 * buf is deleted by the caller. 
847847			 */ 
848- 			obj  =  parse_object_buffer (sha1 , type , size , buf , & eaten );
848+ 			obj  =  parse_object_buffer (oid -> hash , type , size , buf , & eaten );
849849			if  (!obj )
850850				die (_ ("invalid %s" ), typename (type ));
851851			if  (do_fsck_object  && 
@@ -960,7 +960,7 @@ static void resolve_delta(struct object_entry *delta_obj,
960960		       typename (delta_obj -> real_type ),
961961		       delta_obj -> idx .oid .hash );
962962	sha1_object (result -> data , NULL , result -> size , delta_obj -> real_type ,
963- 		    delta_obj -> idx .oid . hash );
963+ 		    & delta_obj -> idx .oid );
964964	counter_lock ();
965965	nr_resolved_deltas ++ ;
966966	counter_unlock ();
@@ -1149,7 +1149,7 @@ static void parse_pack_objects(unsigned char *sha1)
11491149			nr_delays ++ ;
11501150		} else 
11511151			sha1_object (data , NULL , obj -> size , obj -> type ,
1152- 				    obj -> idx .oid . hash );
1152+ 				    & obj -> idx .oid );
11531153		free (data );
11541154		display_progress (progress , i + 1 );
11551155	}
@@ -1176,7 +1176,7 @@ static void parse_pack_objects(unsigned char *sha1)
11761176			continue ;
11771177		obj -> real_type  =  obj -> type ;
11781178		sha1_object (NULL , obj , obj -> size , obj -> type ,
1179- 			    obj -> idx .oid . hash );
1179+ 			    & obj -> idx .oid );
11801180		nr_delays -- ;
11811181	}
11821182	if  (nr_delays )
0 commit comments