@@ -32,6 +32,7 @@ static int no_progress, daemon_mode;
3232static int shallow_nr ;
3333static struct object_array have_obj ;
3434static struct object_array want_obj ;
35+ static struct object_array extra_edge_obj ;
3536static unsigned int timeout ;
3637/* 0 for no sideband,
3738 * otherwise maximum packet size (up to 65520 bytes).
@@ -135,6 +136,10 @@ static int do_rev_list(int fd, void *create_full_pack)
135136 if (prepare_revision_walk (& revs ))
136137 die ("revision walk setup failed" );
137138 mark_edges_uninteresting (revs .commits , & revs , show_edge );
139+ if (use_thin_pack )
140+ for (i = 0 ; i < extra_edge_obj .nr ; i ++ )
141+ fprintf (pack_pipe , "-%s\n" , sha1_to_hex (
142+ extra_edge_obj .objects [i ].item -> sha1 ));
138143 traverse_commit_list (& revs , show_commit , show_object , NULL );
139144 fflush (pack_pipe );
140145 fclose (pack_pipe );
@@ -492,7 +497,6 @@ static void receive_needs(void)
492497 if (!prefixcmp (line , "shallow " )) {
493498 unsigned char sha1 [20 ];
494499 struct object * object ;
495- use_thin_pack = 0 ;
496500 if (get_sha1 (line + 8 , sha1 ))
497501 die ("invalid shallow line: %s" , line );
498502 object = parse_object (sha1 );
@@ -504,7 +508,6 @@ static void receive_needs(void)
504508 }
505509 if (!prefixcmp (line , "deepen " )) {
506510 char * end ;
507- use_thin_pack = 0 ;
508511 depth = strtol (line + 7 , & end , 0 );
509512 if (end == line + 7 || depth <= 0 )
510513 die ("Invalid deepen: %s" , line );
@@ -587,6 +590,7 @@ static void receive_needs(void)
587590 NULL , & want_obj );
588591 parents = parents -> next ;
589592 }
593+ add_object_array (object , NULL , & extra_edge_obj );
590594 }
591595 /* make sure commit traversal conforms to client */
592596 register_shallow (object -> sha1 );
0 commit comments