@@ -2408,6 +2408,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
24082408 struct oidset_iter iter ;
24092409 const struct object_id * oid ;
24102410
2411+ trace2_region_enter ("fetch" , "negotiate-only" , the_repository );
24112412 if (!remote )
24122413 die (_ ("must supply remote when using --negotiate-only" ));
24132414 gtransport = prepare_transport (remote , 1 );
@@ -2416,6 +2417,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
24162417 } else {
24172418 warning (_ ("protocol does not support --negotiate-only, exiting" ));
24182419 result = 1 ;
2420+ trace2_region_leave ("fetch" , "negotiate-only" , the_repository );
24192421 goto cleanup ;
24202422 }
24212423 if (server_options .nr )
@@ -2426,11 +2428,17 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
24262428 while ((oid = oidset_iter_next (& iter )))
24272429 printf ("%s\n" , oid_to_hex (oid ));
24282430 oidset_clear (& acked_commits );
2431+ trace2_region_leave ("fetch" , "negotiate-only" , the_repository );
24292432 } else if (remote ) {
2430- if (filter_options .choice || repo_has_promisor_remote (the_repository ))
2433+ if (filter_options .choice || repo_has_promisor_remote (the_repository )) {
2434+ trace2_region_enter ("fetch" , "setup-partial" , the_repository );
24312435 fetch_one_setup_partial (remote );
2436+ trace2_region_leave ("fetch" , "setup-partial" , the_repository );
2437+ }
2438+ trace2_region_enter ("fetch" , "fetch-one" , the_repository );
24322439 result = fetch_one (remote , argc , argv , prune_tags_ok , stdin_refspecs ,
24332440 & config );
2441+ trace2_region_leave ("fetch" , "fetch-one" , the_repository );
24342442 } else {
24352443 int max_children = max_jobs ;
24362444
@@ -2450,7 +2458,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
24502458 max_children = config .parallel ;
24512459
24522460 /* TODO should this also die if we have a previous partial-clone? */
2461+ trace2_region_enter ("fetch" , "fetch-multiple" , the_repository );
24532462 result = fetch_multiple (& list , max_children , & config );
2463+ trace2_region_leave ("fetch" , "fetch-multiple" , the_repository );
24542464 }
24552465
24562466 /*
@@ -2472,13 +2482,15 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
24722482 max_children = config .parallel ;
24732483
24742484 add_options_to_argv (& options , & config );
2485+ trace2_region_enter_printf ("fetch" , "recurse-submodule" , the_repository , "%s" , submodule_prefix );
24752486 result = fetch_submodules (the_repository ,
24762487 & options ,
24772488 submodule_prefix ,
24782489 config .recurse_submodules ,
24792490 recurse_submodules_default ,
24802491 verbosity < 0 ,
24812492 max_children );
2493+ trace2_region_leave_printf ("fetch" , "recurse-submodule" , the_repository , "%s" , submodule_prefix );
24822494 strvec_clear (& options );
24832495 }
24842496
@@ -2502,9 +2514,11 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
25022514 if (progress )
25032515 commit_graph_flags |= COMMIT_GRAPH_WRITE_PROGRESS ;
25042516
2517+ trace2_region_enter ("fetch" , "write-commit-graph" , the_repository );
25052518 write_commit_graph_reachable (the_repository -> objects -> odb ,
25062519 commit_graph_flags ,
25072520 NULL );
2521+ trace2_region_leave ("fetch" , "write-commit-graph" , the_repository );
25082522 }
25092523
25102524 if (enable_auto_gc ) {
0 commit comments