@@ -443,14 +443,17 @@ static int module_name(int argc, const char **argv, const char *prefix)
443
443
}
444
444
445
445
static int clone_submodule (const char * path , const char * gitdir , const char * url ,
446
- const char * depth , struct string_list * reference , int quiet )
446
+ const char * depth , struct string_list * reference ,
447
+ int quiet , int progress )
447
448
{
448
449
struct child_process cp = CHILD_PROCESS_INIT ;
449
450
450
451
argv_array_push (& cp .args , "clone" );
451
452
argv_array_push (& cp .args , "--no-checkout" );
452
453
if (quiet )
453
454
argv_array_push (& cp .args , "--quiet" );
455
+ if (progress )
456
+ argv_array_push (& cp .args , "--progress" );
454
457
if (depth && * depth )
455
458
argv_array_pushl (& cp .args , "--depth" , depth , NULL );
456
459
if (reference -> nr ) {
@@ -575,6 +578,7 @@ static int module_clone(int argc, const char **argv, const char *prefix)
575
578
{
576
579
const char * name = NULL , * url = NULL , * depth = NULL ;
577
580
int quiet = 0 ;
581
+ int progress = 0 ;
578
582
FILE * submodule_dot_git ;
579
583
char * p , * path = NULL , * sm_gitdir ;
580
584
struct strbuf rel_path = STRBUF_INIT ;
@@ -601,6 +605,8 @@ static int module_clone(int argc, const char **argv, const char *prefix)
601
605
N_ ("string" ),
602
606
N_ ("depth for shallow clones" )),
603
607
OPT__QUIET (& quiet , "Suppress output for cloning a submodule" ),
608
+ OPT_BOOL (0 , "progress" , & progress ,
609
+ N_ ("force cloning progress" )),
604
610
OPT_END ()
605
611
};
606
612
@@ -634,7 +640,8 @@ static int module_clone(int argc, const char **argv, const char *prefix)
634
640
635
641
prepare_possible_alternates (name , & reference );
636
642
637
- if (clone_submodule (path , sm_gitdir , url , depth , & reference , quiet ))
643
+ if (clone_submodule (path , sm_gitdir , url , depth , & reference ,
644
+ quiet , progress ))
638
645
die (_ ("clone of '%s' into submodule path '%s' failed" ),
639
646
url , path );
640
647
} else {
@@ -684,6 +691,7 @@ struct submodule_update_clone {
684
691
struct submodule_update_strategy update ;
685
692
686
693
/* configuration parameters which are passed on to the children */
694
+ int progress ;
687
695
int quiet ;
688
696
int recommend_shallow ;
689
697
struct string_list references ;
@@ -702,7 +710,7 @@ struct submodule_update_clone {
702
710
int failed_clones_nr , failed_clones_alloc ;
703
711
};
704
712
#define SUBMODULE_UPDATE_CLONE_INIT {0, MODULE_LIST_INIT, 0, \
705
- SUBMODULE_UPDATE_STRATEGY_INIT, 0, -1, STRING_LIST_INIT_DUP, \
713
+ SUBMODULE_UPDATE_STRATEGY_INIT, 0, 0, -1, STRING_LIST_INIT_DUP, \
706
714
NULL, NULL, NULL, \
707
715
STRING_LIST_INIT_DUP, 0, NULL, 0, 0}
708
716
@@ -804,6 +812,8 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
804
812
child -> err = -1 ;
805
813
argv_array_push (& child -> args , "submodule--helper" );
806
814
argv_array_push (& child -> args , "clone" );
815
+ if (suc -> progress )
816
+ argv_array_push (& child -> args , "--progress" );
807
817
if (suc -> quiet )
808
818
argv_array_push (& child -> args , "--quiet" );
809
819
if (suc -> prefix )
@@ -951,6 +961,8 @@ static int update_clone(int argc, const char **argv, const char *prefix)
951
961
OPT_BOOL (0 , "recommend-shallow" , & suc .recommend_shallow ,
952
962
N_ ("whether the initial clone should follow the shallow recommendation" )),
953
963
OPT__QUIET (& suc .quiet , N_ ("don't print cloning progress" )),
964
+ OPT_BOOL (0 , "progress" , & suc .progress ,
965
+ N_ ("force cloning progress" )),
954
966
OPT_END ()
955
967
};
956
968
0 commit comments