@@ -27,6 +27,7 @@ struct helper_data {
2727 push : 1 ,
2828 connect : 1 ,
2929 signed_tags : 1 ,
30+ check_connectivity : 1 ,
3031 no_disconnect_req : 1 ;
3132 char * export_marks ;
3233 char * import_marks ;
@@ -186,6 +187,8 @@ static struct child_process *get_helper(struct transport *transport)
186187 data -> bidi_import = 1 ;
187188 else if (!strcmp (capname , "export" ))
188189 data -> export = 1 ;
190+ else if (!strcmp (capname , "check-connectivity" ))
191+ data -> check_connectivity = 1 ;
189192 else if (!data -> refspecs && !prefixcmp (capname , "refspec " )) {
190193 ALLOC_GROW (refspecs ,
191194 refspec_nr + 1 ,
@@ -349,6 +352,9 @@ static int fetch_with_fetch(struct transport *transport,
349352 struct strbuf buf = STRBUF_INIT ;
350353
351354 standard_options (transport );
355+ if (data -> check_connectivity &&
356+ data -> transport_options .check_self_contained_and_connected )
357+ set_helper_option (transport , "check-connectivity" , "true" );
352358
353359 for (i = 0 ; i < nr_heads ; i ++ ) {
354360 const struct ref * posn = to_fetch [i ];
@@ -372,6 +378,10 @@ static int fetch_with_fetch(struct transport *transport,
372378 else
373379 transport -> pack_lockfile = xstrdup (name );
374380 }
381+ else if (data -> check_connectivity &&
382+ data -> transport_options .check_self_contained_and_connected &&
383+ !strcmp (buf .buf , "connectivity-ok" ))
384+ data -> transport_options .self_contained_and_connected = 1 ;
375385 else if (!buf .len )
376386 break ;
377387 else
0 commit comments