@@ -785,7 +785,7 @@ static int check_collison(struct object_entry *entry)
785
785
786
786
static void sha1_object (const void * data , struct object_entry * obj_entry ,
787
787
unsigned long size , enum object_type type ,
788
- const unsigned char * sha1 )
788
+ const struct object_id * oid )
789
789
{
790
790
void * new_data = NULL ;
791
791
int collision_test_needed = 0 ;
@@ -794,7 +794,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
794
794
795
795
if (startup_info -> have_repository ) {
796
796
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 );
798
798
read_unlock ();
799
799
}
800
800
@@ -809,31 +809,31 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
809
809
enum object_type has_type ;
810
810
unsigned long has_size ;
811
811
read_lock ();
812
- has_type = sha1_object_info (sha1 , & has_size );
812
+ has_type = sha1_object_info (oid -> hash , & has_size );
813
813
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 ));
815
815
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 );
818
818
read_unlock ();
819
819
if (!data )
820
820
data = new_data = get_data_from_pack (obj_entry );
821
821
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 ));
823
823
if (size != has_size || type != has_type ||
824
824
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 ));
826
826
free (has_data );
827
827
}
828
828
829
829
if (strict ) {
830
830
read_lock ();
831
831
if (type == OBJ_BLOB ) {
832
- struct blob * blob = lookup_blob (sha1 );
832
+ struct blob * blob = lookup_blob (oid -> hash );
833
833
if (blob )
834
834
blob -> object .flags |= FLAG_CHECKED ;
835
835
else
836
- die (_ ("invalid blob object %s" ), sha1_to_hex ( sha1 ));
836
+ die (_ ("invalid blob object %s" ), oid_to_hex ( oid ));
837
837
} else {
838
838
struct object * obj ;
839
839
int eaten ;
@@ -845,7 +845,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
845
845
* we do not need to free the memory here, as the
846
846
* buf is deleted by the caller.
847
847
*/
848
- obj = parse_object_buffer (sha1 , type , size , buf , & eaten );
848
+ obj = parse_object_buffer (oid -> hash , type , size , buf , & eaten );
849
849
if (!obj )
850
850
die (_ ("invalid %s" ), typename (type ));
851
851
if (do_fsck_object &&
@@ -960,7 +960,7 @@ static void resolve_delta(struct object_entry *delta_obj,
960
960
typename (delta_obj -> real_type ),
961
961
delta_obj -> idx .oid .hash );
962
962
sha1_object (result -> data , NULL , result -> size , delta_obj -> real_type ,
963
- delta_obj -> idx .oid . hash );
963
+ & delta_obj -> idx .oid );
964
964
counter_lock ();
965
965
nr_resolved_deltas ++ ;
966
966
counter_unlock ();
@@ -1149,7 +1149,7 @@ static void parse_pack_objects(unsigned char *sha1)
1149
1149
nr_delays ++ ;
1150
1150
} else
1151
1151
sha1_object (data , NULL , obj -> size , obj -> type ,
1152
- obj -> idx .oid . hash );
1152
+ & obj -> idx .oid );
1153
1153
free (data );
1154
1154
display_progress (progress , i + 1 );
1155
1155
}
@@ -1176,7 +1176,7 @@ static void parse_pack_objects(unsigned char *sha1)
1176
1176
continue ;
1177
1177
obj -> real_type = obj -> type ;
1178
1178
sha1_object (NULL , obj , obj -> size , obj -> type ,
1179
- obj -> idx .oid . hash );
1179
+ & obj -> idx .oid );
1180
1180
nr_delays -- ;
1181
1181
}
1182
1182
if (nr_delays )
0 commit comments