@@ -285,10 +285,8 @@ static int find_common(struct fetch_negotiator *negotiator,
285285 PACKET_READ_CHOMP_NEWLINE |
286286 PACKET_READ_DIE_ON_ERR_PACKET );
287287
288- if (!args -> no_dependents ) {
289- mark_tips (negotiator , args -> negotiation_tips );
290- for_each_cached_alternate (negotiator , insert_one_alternate_object );
291- }
288+ mark_tips (negotiator , args -> negotiation_tips );
289+ for_each_cached_alternate (negotiator , insert_one_alternate_object );
292290
293291 fetching = 0 ;
294292 for ( ; refs ; refs = refs -> next ) {
@@ -305,12 +303,8 @@ static int find_common(struct fetch_negotiator *negotiator,
305303 * We use lookup_object here because we are only
306304 * interested in the case we *know* the object is
307305 * reachable and we have already scanned it.
308- *
309- * Do this only if args->no_dependents is false (if it is true,
310- * we cannot trust the object flags).
311306 */
312- if (!args -> no_dependents &&
313- ((o = lookup_object (the_repository , remote )) != NULL ) &&
307+ if (((o = lookup_object (the_repository , remote )) != NULL ) &&
314308 (o -> flags & COMPLETE )) {
315309 continue ;
316310 }
@@ -410,8 +404,6 @@ static int find_common(struct fetch_negotiator *negotiator,
410404 trace2_region_enter ("fetch-pack" , "negotiation_v0_v1" , the_repository );
411405 flushes = 0 ;
412406 retval = -1 ;
413- if (args -> no_dependents )
414- goto done ;
415407 while ((oid = negotiator -> next (negotiator ))) {
416408 packet_buf_write (& req_buf , "have %s\n" , oid_to_hex (oid ));
417409 print_verbose (args , "have %s" , oid_to_hex (oid ));
@@ -666,9 +658,7 @@ struct loose_object_iter {
666658
667659/*
668660 * Mark recent commits available locally and reachable from a local ref as
669- * COMPLETE. If args->no_dependents is false, also mark COMPLETE remote refs as
670- * COMMON_REF (otherwise, we are not planning to participate in negotiation, and
671- * thus do not need COMMON_REF marks).
661+ * COMPLETE.
672662 *
673663 * The cutoff time for recency is determined by this heuristic: it is the
674664 * earliest commit time of the objects in refs that are commits and that we know
@@ -969,12 +959,8 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
969959 struct fetch_negotiator negotiator_alloc ;
970960 struct fetch_negotiator * negotiator ;
971961
972- if (args -> no_dependents ) {
973- negotiator = NULL ;
974- } else {
975- negotiator = & negotiator_alloc ;
976- fetch_negotiator_init (r , negotiator );
977- }
962+ negotiator = & negotiator_alloc ;
963+ fetch_negotiator_init (r , negotiator );
978964
979965 sort_ref_list (& ref , ref_compare_name );
980966 QSORT (sought , nr_sought , cmp_ref_by_name );
@@ -1062,15 +1048,11 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
10621048 if (!server_supports_hash (the_hash_algo -> name , NULL ))
10631049 die (_ ("Server does not support this repository's object format" ));
10641050
1065- if (!args -> no_dependents ) {
1066- mark_complete_and_common_ref (negotiator , args , & ref );
1067- filter_refs (args , & ref , sought , nr_sought );
1068- if (everything_local (args , & ref )) {
1069- packet_flush (fd [1 ]);
1070- goto all_done ;
1071- }
1072- } else {
1073- filter_refs (args , & ref , sought , nr_sought );
1051+ mark_complete_and_common_ref (negotiator , args , & ref );
1052+ filter_refs (args , & ref , sought , nr_sought );
1053+ if (everything_local (args , & ref )) {
1054+ packet_flush (fd [1 ]);
1055+ goto all_done ;
10741056 }
10751057 if (find_common (negotiator , args , fd , & oid , ref ) < 0 )
10761058 if (!args -> keep_pack )
@@ -1119,7 +1101,7 @@ static void add_shallow_requests(struct strbuf *req_buf,
11191101 packet_buf_write (req_buf , "deepen-relative\n" );
11201102}
11211103
1122- static void add_wants (int no_dependents , const struct ref * wants , struct strbuf * req_buf )
1104+ static void add_wants (const struct ref * wants , struct strbuf * req_buf )
11231105{
11241106 int use_ref_in_want = server_supports_feature ("fetch" , "ref-in-want" , 0 );
11251107
@@ -1136,12 +1118,8 @@ static void add_wants(int no_dependents, const struct ref *wants, struct strbuf
11361118 * We use lookup_object here because we are only
11371119 * interested in the case we *know* the object is
11381120 * reachable and we have already scanned it.
1139- *
1140- * Do this only if args->no_dependents is false (if it is true,
1141- * we cannot trust the object flags).
11421121 */
1143- if (!no_dependents &&
1144- ((o = lookup_object (the_repository , remote )) != NULL ) &&
1122+ if (((o = lookup_object (the_repository , remote )) != NULL ) &&
11451123 (o -> flags & COMPLETE )) {
11461124 continue ;
11471125 }
@@ -1275,19 +1253,14 @@ static int send_fetch_request(struct fetch_negotiator *negotiator, int fd_out,
12751253 }
12761254
12771255 /* add wants */
1278- add_wants (args -> no_dependents , wants , & req_buf );
1256+ add_wants (wants , & req_buf );
12791257
1280- if (args -> no_dependents ) {
1281- packet_buf_write (& req_buf , "done" );
1282- ret = 1 ;
1283- } else {
1284- /* Add all of the common commits we've found in previous rounds */
1285- add_common (& req_buf , common );
1258+ /* Add all of the common commits we've found in previous rounds */
1259+ add_common (& req_buf , common );
12861260
1287- /* Add initial haves */
1288- ret = add_haves (negotiator , seen_ack , & req_buf ,
1289- haves_to_send , in_vain );
1290- }
1261+ /* Add initial haves */
1262+ ret = add_haves (negotiator , seen_ack , & req_buf ,
1263+ haves_to_send , in_vain );
12911264
12921265 /* Send request */
12931266 packet_buf_flush (& req_buf );
@@ -1547,12 +1520,8 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
15471520 struct string_list packfile_uris = STRING_LIST_INIT_DUP ;
15481521 int i ;
15491522
1550- if (args -> no_dependents ) {
1551- negotiator = NULL ;
1552- } else {
1553- negotiator = & negotiator_alloc ;
1554- fetch_negotiator_init (r , negotiator );
1555- }
1523+ negotiator = & negotiator_alloc ;
1524+ fetch_negotiator_init (r , negotiator );
15561525
15571526 packet_reader_init (& reader , fd [0 ], NULL , 0 ,
15581527 PACKET_READ_CHOMP_NEWLINE |
@@ -1576,21 +1545,16 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
15761545 args -> deepen = 1 ;
15771546
15781547 /* Filter 'ref' by 'sought' and those that aren't local */
1579- if (!args -> no_dependents ) {
1580- mark_complete_and_common_ref (negotiator , args , & ref );
1581- filter_refs (args , & ref , sought , nr_sought );
1582- if (everything_local (args , & ref ))
1583- state = FETCH_DONE ;
1584- else
1585- state = FETCH_SEND_REQUEST ;
1586-
1587- mark_tips (negotiator , args -> negotiation_tips );
1588- for_each_cached_alternate (negotiator ,
1589- insert_one_alternate_object );
1590- } else {
1591- filter_refs (args , & ref , sought , nr_sought );
1548+ mark_complete_and_common_ref (negotiator , args , & ref );
1549+ filter_refs (args , & ref , sought , nr_sought );
1550+ if (everything_local (args , & ref ))
1551+ state = FETCH_DONE ;
1552+ else
15921553 state = FETCH_SEND_REQUEST ;
1593- }
1554+
1555+ mark_tips (negotiator , args -> negotiation_tips );
1556+ for_each_cached_alternate (negotiator ,
1557+ insert_one_alternate_object );
15941558 break ;
15951559 case FETCH_SEND_REQUEST :
15961560 if (!negotiation_started ) {
@@ -1911,20 +1875,6 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
19111875 if (nr_sought )
19121876 nr_sought = remove_duplicates_in_refs (sought , nr_sought );
19131877
1914- if (args -> no_dependents && !args -> filter_options .choice ) {
1915- /*
1916- * The protocol does not support requesting that only the
1917- * wanted objects be sent, so approximate this by setting a
1918- * "blob:none" filter if no filter is already set. This works
1919- * for all object types: note that wanted blobs will still be
1920- * sent because they are directly specified as a "want".
1921- *
1922- * NEEDSWORK: Add an option in the protocol to request that
1923- * only the wanted objects be sent, and implement it.
1924- */
1925- parse_list_objects_filter (& args -> filter_options , "blob:none" );
1926- }
1927-
19281878 if (version != protocol_v2 && !ref ) {
19291879 packet_flush (fd [1 ]);
19301880 die (_ ("no matching remote head" ));
0 commit comments