@@ -1553,7 +1553,7 @@ static int backfill_tags(struct display_state *display_state,
1553
1553
1554
1554
static int do_fetch (struct transport * transport ,
1555
1555
struct refspec * rs ,
1556
- enum display_format display_format )
1556
+ const struct fetch_config * config )
1557
1557
{
1558
1558
struct ref_transaction * transaction = NULL ;
1559
1559
struct ref * ref_map = NULL ;
@@ -1639,7 +1639,8 @@ static int do_fetch(struct transport *transport,
1639
1639
if (retcode )
1640
1640
goto cleanup ;
1641
1641
1642
- display_state_init (& display_state , ref_map , transport -> url , display_format );
1642
+ display_state_init (& display_state , ref_map , transport -> url ,
1643
+ config -> display_format );
1643
1644
1644
1645
if (atomic_fetch ) {
1645
1646
transaction = ref_transaction_begin (& err );
@@ -1828,7 +1829,7 @@ static int add_remote_or_group(const char *name, struct string_list *list)
1828
1829
}
1829
1830
1830
1831
static void add_options_to_argv (struct strvec * argv ,
1831
- enum display_format format )
1832
+ const struct fetch_config * config )
1832
1833
{
1833
1834
if (dry_run )
1834
1835
strvec_push (argv , "--dry-run" );
@@ -1864,7 +1865,7 @@ static void add_options_to_argv(struct strvec *argv,
1864
1865
strvec_push (argv , "--ipv6" );
1865
1866
if (!write_fetch_head )
1866
1867
strvec_push (argv , "--no-write-fetch-head" );
1867
- if (format == DISPLAY_FORMAT_PORCELAIN )
1868
+ if (config -> display_format == DISPLAY_FORMAT_PORCELAIN )
1868
1869
strvec_pushf (argv , "--porcelain" );
1869
1870
}
1870
1871
@@ -1874,7 +1875,7 @@ struct parallel_fetch_state {
1874
1875
const char * * argv ;
1875
1876
struct string_list * remotes ;
1876
1877
int next , result ;
1877
- enum display_format format ;
1878
+ const struct fetch_config * config ;
1878
1879
};
1879
1880
1880
1881
static int fetch_next_remote (struct child_process * cp ,
@@ -1894,7 +1895,7 @@ static int fetch_next_remote(struct child_process *cp,
1894
1895
strvec_push (& cp -> args , remote );
1895
1896
cp -> git_cmd = 1 ;
1896
1897
1897
- if (verbosity >= 0 && state -> format != DISPLAY_FORMAT_PORCELAIN )
1898
+ if (verbosity >= 0 && state -> config -> display_format != DISPLAY_FORMAT_PORCELAIN )
1898
1899
printf (_ ("Fetching %s\n" ), remote );
1899
1900
1900
1901
return 1 ;
@@ -1927,7 +1928,7 @@ static int fetch_finished(int result, struct strbuf *out,
1927
1928
}
1928
1929
1929
1930
static int fetch_multiple (struct string_list * list , int max_children ,
1930
- enum display_format format )
1931
+ const struct fetch_config * config )
1931
1932
{
1932
1933
int i , result = 0 ;
1933
1934
struct strvec argv = STRVEC_INIT ;
@@ -1945,10 +1946,10 @@ static int fetch_multiple(struct string_list *list, int max_children,
1945
1946
strvec_pushl (& argv , "-c" , "fetch.bundleURI=" ,
1946
1947
"fetch" , "--append" , "--no-auto-gc" ,
1947
1948
"--no-write-commit-graph" , NULL );
1948
- add_options_to_argv (& argv , format );
1949
+ add_options_to_argv (& argv , config );
1949
1950
1950
1951
if (max_children != 1 && list -> nr != 1 ) {
1951
- struct parallel_fetch_state state = { argv .v , list , 0 , 0 , format };
1952
+ struct parallel_fetch_state state = { argv .v , list , 0 , 0 , config };
1952
1953
const struct run_process_parallel_opts opts = {
1953
1954
.tr2_category = "fetch" ,
1954
1955
.tr2_label = "parallel/fetch" ,
@@ -1972,7 +1973,7 @@ static int fetch_multiple(struct string_list *list, int max_children,
1972
1973
1973
1974
strvec_pushv (& cmd .args , argv .v );
1974
1975
strvec_push (& cmd .args , name );
1975
- if (verbosity >= 0 && format != DISPLAY_FORMAT_PORCELAIN )
1976
+ if (verbosity >= 0 && config -> display_format != DISPLAY_FORMAT_PORCELAIN )
1976
1977
printf (_ ("Fetching %s\n" ), name );
1977
1978
cmd .git_cmd = 1 ;
1978
1979
if (run_command (& cmd )) {
@@ -2028,7 +2029,7 @@ static inline void fetch_one_setup_partial(struct remote *remote)
2028
2029
2029
2030
static int fetch_one (struct remote * remote , int argc , const char * * argv ,
2030
2031
int prune_tags_ok , int use_stdin_refspecs ,
2031
- enum display_format display_format )
2032
+ const struct fetch_config * config )
2032
2033
{
2033
2034
struct refspec rs = REFSPEC_INIT_FETCH ;
2034
2035
int i ;
@@ -2095,7 +2096,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
2095
2096
sigchain_push_common (unlock_pack_on_signal );
2096
2097
atexit (unlock_pack_atexit );
2097
2098
sigchain_push (SIGPIPE , SIG_IGN );
2098
- exit_code = do_fetch (gtransport , & rs , display_format );
2099
+ exit_code = do_fetch (gtransport , & rs , config );
2099
2100
sigchain_pop (SIGPIPE );
2100
2101
refspec_clear (& rs );
2101
2102
transport_disconnect (gtransport );
@@ -2383,7 +2384,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
2383
2384
if (filter_options .choice || repo_has_promisor_remote (the_repository ))
2384
2385
fetch_one_setup_partial (remote );
2385
2386
result = fetch_one (remote , argc , argv , prune_tags_ok , stdin_refspecs ,
2386
- config . display_format );
2387
+ & config );
2387
2388
} else {
2388
2389
int max_children = max_jobs ;
2389
2390
@@ -2403,7 +2404,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
2403
2404
max_children = fetch_parallel_config ;
2404
2405
2405
2406
/* TODO should this also die if we have a previous partial-clone? */
2406
- result = fetch_multiple (& list , max_children , config . display_format );
2407
+ result = fetch_multiple (& list , max_children , & config );
2407
2408
}
2408
2409
2409
2410
/*
@@ -2424,7 +2425,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
2424
2425
if (max_children < 0 )
2425
2426
max_children = fetch_parallel_config ;
2426
2427
2427
- add_options_to_argv (& options , config . display_format );
2428
+ add_options_to_argv (& options , & config );
2428
2429
result = fetch_submodules (the_repository ,
2429
2430
& options ,
2430
2431
submodule_prefix ,
0 commit comments