@@ -422,20 +422,18 @@ void set_config_fetch_recurse_submodules(int value)
422
422
config_fetch_recurse_submodules = value ;
423
423
}
424
424
425
- static int has_remote (const char * refname , const unsigned char * sha1 , int flags , void * cb_data )
425
+ static int has_remote (const char * refname , const struct object_id * oid ,
426
+ int flags , void * cb_data )
426
427
{
427
428
return 1 ;
428
429
}
429
430
430
431
static int submodule_needs_pushing (const char * path , const unsigned char sha1 [20 ])
431
432
{
432
- struct each_ref_fn_sha1_adapter wrapped_has_remote =
433
- {has_remote , NULL };
434
-
435
433
if (add_submodule_odb (path ) || !lookup_commit_reference (sha1 ))
436
434
return 0 ;
437
435
438
- if (for_each_remote_ref_submodule (path , each_ref_fn_adapter , & wrapped_has_remote ) > 0 ) {
436
+ if (for_each_remote_ref_submodule (path , has_remote , NULL ) > 0 ) {
439
437
struct child_process cp = CHILD_PROCESS_INIT ;
440
438
const char * argv [] = {"rev-list" , NULL , "--not" , "--remotes" , "-n" , "1" , NULL };
441
439
struct strbuf buf = STRBUF_INIT ;
@@ -522,13 +520,10 @@ int find_unpushed_submodules(unsigned char new_sha1[20],
522
520
523
521
static int push_submodule (const char * path )
524
522
{
525
- struct each_ref_fn_sha1_adapter wrapped_has_remote =
526
- {has_remote , NULL };
527
-
528
523
if (add_submodule_odb (path ))
529
524
return 1 ;
530
525
531
- if (for_each_remote_ref_submodule (path , each_ref_fn_adapter , & wrapped_has_remote ) > 0 ) {
526
+ if (for_each_remote_ref_submodule (path , has_remote , NULL ) > 0 ) {
532
527
struct child_process cp = CHILD_PROCESS_INIT ;
533
528
const char * argv [] = {"push" , NULL };
534
529
@@ -622,20 +617,17 @@ static void submodule_collect_changed_cb(struct diff_queue_struct *q,
622
617
}
623
618
}
624
619
625
- static int add_sha1_to_array (const char * ref , const unsigned char * sha1 ,
620
+ static int add_sha1_to_array (const char * ref , const struct object_id * oid ,
626
621
int flags , void * data )
627
622
{
628
- sha1_array_append (data , sha1 );
623
+ sha1_array_append (data , oid -> hash );
629
624
return 0 ;
630
625
}
631
626
632
627
void check_for_new_submodule_commits (unsigned char new_sha1 [20 ])
633
628
{
634
629
if (!initialized_fetch_ref_tips ) {
635
- struct each_ref_fn_sha1_adapter wrapped_add_sha1_to_array =
636
- {add_sha1_to_array , & ref_tips_before_fetch };
637
-
638
- for_each_ref (each_ref_fn_adapter , & wrapped_add_sha1_to_array );
630
+ for_each_ref (add_sha1_to_array , & ref_tips_before_fetch );
639
631
initialized_fetch_ref_tips = 1 ;
640
632
}
641
633
0 commit comments