@@ -51,7 +51,6 @@ static timestamp_t oldest_have;
51
51
/* Allow request of any sha1. Implies ALLOW_TIP_SHA1 and ALLOW_REACHABLE_SHA1. */
52
52
#define ALLOW_ANY_SHA1 07
53
53
static unsigned int allow_unadvertised_object_request ;
54
- static int shallow_nr ;
55
54
static struct object_array extra_edge_obj ;
56
55
57
56
/*
@@ -72,6 +71,7 @@ struct upload_pack_data {
72
71
int deepen_rev_list ;
73
72
int deepen_relative ;
74
73
int keepalive ;
74
+ int shallow_nr ;
75
75
76
76
unsigned int timeout ; /* v0 only */
77
77
enum {
@@ -192,7 +192,7 @@ static void create_pack_file(struct upload_pack_data *pack_data)
192
192
pack_objects .use_shell = 1 ;
193
193
}
194
194
195
- if (shallow_nr ) {
195
+ if (pack_data -> shallow_nr ) {
196
196
argv_array_push (& pack_objects .args , "--shallow-file" );
197
197
argv_array_push (& pack_objects .args , "" );
198
198
}
@@ -202,7 +202,7 @@ static void create_pack_file(struct upload_pack_data *pack_data)
202
202
argv_array_push (& pack_objects .args , "--thin" );
203
203
204
204
argv_array_push (& pack_objects .args , "--stdout" );
205
- if (shallow_nr )
205
+ if (pack_data -> shallow_nr )
206
206
argv_array_push (& pack_objects .args , "--shallow" );
207
207
if (!pack_data -> no_progress )
208
208
argv_array_push (& pack_objects .args , "--progress" );
@@ -233,7 +233,7 @@ static void create_pack_file(struct upload_pack_data *pack_data)
233
233
234
234
pipe_fd = xfdopen (pack_objects .in , "w" );
235
235
236
- if (shallow_nr )
236
+ if (pack_data -> shallow_nr )
237
237
for_each_commit_graft (write_one_shallow , pipe_fd );
238
238
239
239
for (i = 0 ; i < pack_data -> want_obj .nr ; i ++ )
@@ -700,16 +700,16 @@ static void check_non_tip(struct upload_pack_data *data)
700
700
}
701
701
}
702
702
703
- static void send_shallow (struct packet_writer * writer ,
703
+ static void send_shallow (struct upload_pack_data * data ,
704
704
struct commit_list * result )
705
705
{
706
706
while (result ) {
707
707
struct object * object = & result -> item -> object ;
708
708
if (!(object -> flags & (CLIENT_SHALLOW |NOT_SHALLOW ))) {
709
- packet_writer_write (writer , "shallow %s" ,
709
+ packet_writer_write (& data -> writer , "shallow %s" ,
710
710
oid_to_hex (& object -> oid ));
711
711
register_shallow (the_repository , & object -> oid );
712
- shallow_nr ++ ;
712
+ data -> shallow_nr ++ ;
713
713
}
714
714
result = result -> next ;
715
715
}
@@ -775,15 +775,15 @@ static void deepen(struct upload_pack_data *data, int depth)
775
775
result = get_shallow_commits (& reachable_shallows ,
776
776
depth + 1 ,
777
777
SHALLOW , NOT_SHALLOW );
778
- send_shallow (& data -> writer , result );
778
+ send_shallow (data , result );
779
779
free_commit_list (result );
780
780
object_array_clear (& reachable_shallows );
781
781
} else {
782
782
struct commit_list * result ;
783
783
784
784
result = get_shallow_commits (& data -> want_obj , depth ,
785
785
SHALLOW , NOT_SHALLOW );
786
- send_shallow (& data -> writer , result );
786
+ send_shallow (data , result );
787
787
free_commit_list (result );
788
788
}
789
789
@@ -798,7 +798,7 @@ static void deepen_by_rev_list(struct upload_pack_data *data,
798
798
799
799
disable_commit_graph (the_repository );
800
800
result = get_shallow_commits_by_rev_list (ac , av , SHALLOW , NOT_SHALLOW );
801
- send_shallow (& data -> writer , result );
801
+ send_shallow (data , result );
802
802
free_commit_list (result );
803
803
send_unshallow (data );
804
804
}
@@ -844,7 +844,7 @@ static int send_shallow_list(struct upload_pack_data *data)
844
844
}
845
845
}
846
846
847
- shallow_nr += data -> shallows .nr ;
847
+ data -> shallow_nr += data -> shallows .nr ;
848
848
return ret ;
849
849
}
850
850
@@ -922,7 +922,7 @@ static void receive_needs(struct upload_pack_data *data,
922
922
{
923
923
int has_non_tip = 0 ;
924
924
925
- shallow_nr = 0 ;
925
+ data -> shallow_nr = 0 ;
926
926
for (;;) {
927
927
struct object * o ;
928
928
const char * features ;
0 commit comments