@@ -147,14 +147,14 @@ static int fill_active_slot(void *data UNUSED)
147147 return 0 ;
148148}
149149
150- static void prefetch (struct walker * walker , unsigned char * sha1 )
150+ static void prefetch (struct walker * walker , const struct object_id * oid )
151151{
152152 struct object_request * newreq ;
153153 struct walker_data * data = walker -> data ;
154154
155155 newreq = xmalloc (sizeof (* newreq ));
156156 newreq -> walker = walker ;
157- oidread (& newreq -> oid , sha1 , the_repository -> hash_algo );
157+ oidcpy (& newreq -> oid , oid );
158158 newreq -> repo = data -> alt ;
159159 newreq -> state = WAITING ;
160160 newreq -> req = NULL ;
@@ -422,7 +422,8 @@ static int fetch_indices(struct walker *walker, struct alt_base *repo)
422422 return ret ;
423423}
424424
425- static int http_fetch_pack (struct walker * walker , struct alt_base * repo , unsigned char * sha1 )
425+ static int http_fetch_pack (struct walker * walker , struct alt_base * repo ,
426+ const struct object_id * oid )
426427{
427428 struct packed_git * target ;
428429 int ret ;
@@ -431,7 +432,7 @@ static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigne
431432
432433 if (fetch_indices (walker , repo ))
433434 return -1 ;
434- target = find_sha1_pack ( sha1 , repo -> packs );
435+ target = find_oid_pack ( oid , repo -> packs );
435436 if (!target )
436437 return -1 ;
437438 close_pack_index (target );
@@ -440,7 +441,7 @@ static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigne
440441 fprintf (stderr , "Getting pack %s\n" ,
441442 hash_to_hex (target -> hash ));
442443 fprintf (stderr , " which contains %s\n" ,
443- hash_to_hex ( sha1 ));
444+ oid_to_hex ( oid ));
444445 }
445446
446447 preq = new_http_pack_request (target -> hash , repo -> base );
@@ -477,17 +478,17 @@ static void abort_object_request(struct object_request *obj_req)
477478 release_object_request (obj_req );
478479}
479480
480- static int fetch_object (struct walker * walker , unsigned char * hash )
481+ static int fetch_object (struct walker * walker , const struct object_id * oid )
481482{
482- char * hex = hash_to_hex ( hash );
483+ char * hex = oid_to_hex ( oid );
483484 int ret = 0 ;
484485 struct object_request * obj_req = NULL ;
485486 struct http_object_request * req ;
486487 struct list_head * pos , * head = & object_queue_head ;
487488
488489 list_for_each (pos , head ) {
489490 obj_req = list_entry (pos , struct object_request , node );
490- if (hasheq ( obj_req -> oid . hash , hash , the_repository -> hash_algo ))
491+ if (oideq ( & obj_req -> oid , oid ))
491492 break ;
492493 }
493494 if (!obj_req )
@@ -548,20 +549,20 @@ static int fetch_object(struct walker *walker, unsigned char *hash)
548549 return ret ;
549550}
550551
551- static int fetch (struct walker * walker , unsigned char * hash )
552+ static int fetch (struct walker * walker , const struct object_id * oid )
552553{
553554 struct walker_data * data = walker -> data ;
554555 struct alt_base * altbase = data -> alt ;
555556
556- if (!fetch_object (walker , hash ))
557+ if (!fetch_object (walker , oid ))
557558 return 0 ;
558559 while (altbase ) {
559- if (!http_fetch_pack (walker , altbase , hash ))
560+ if (!http_fetch_pack (walker , altbase , oid ))
560561 return 0 ;
561562 fetch_alternates (walker , data -> alt -> base );
562563 altbase = altbase -> next ;
563564 }
564- return error ("Unable to find %s under %s" , hash_to_hex ( hash ),
565+ return error ("Unable to find %s under %s" , oid_to_hex ( oid ),
565566 data -> alt -> base );
566567}
567568
0 commit comments