@@ -161,9 +161,7 @@ static int write_one_shallow(const struct commit_graft *graft, void *cb_data)
161
161
return 0 ;
162
162
}
163
163
164
- static void create_pack_file (const struct object_array * have_obj ,
165
- const struct object_array * want_obj ,
166
- struct list_objects_filter_options * filter_options )
164
+ static void create_pack_file (struct upload_pack_data * pack_data )
167
165
{
168
166
struct child_process pack_objects = CHILD_PROCESS_INIT ;
169
167
char data [8193 ], progress [128 ];
@@ -200,9 +198,9 @@ static void create_pack_file(const struct object_array *have_obj,
200
198
argv_array_push (& pack_objects .args , "--delta-base-offset" );
201
199
if (use_include_tag )
202
200
argv_array_push (& pack_objects .args , "--include-tag" );
203
- if (filter_options -> choice ) {
201
+ if (pack_data -> filter_options . choice ) {
204
202
const char * spec =
205
- expand_list_objects_filter_spec (filter_options );
203
+ expand_list_objects_filter_spec (& pack_data -> filter_options );
206
204
if (pack_objects .use_shell ) {
207
205
struct strbuf buf = STRBUF_INIT ;
208
206
sq_quote_buf (& buf , spec );
@@ -226,13 +224,13 @@ static void create_pack_file(const struct object_array *have_obj,
226
224
if (shallow_nr )
227
225
for_each_commit_graft (write_one_shallow , pipe_fd );
228
226
229
- for (i = 0 ; i < want_obj -> nr ; i ++ )
227
+ for (i = 0 ; i < pack_data -> want_obj . nr ; i ++ )
230
228
fprintf (pipe_fd , "%s\n" ,
231
- oid_to_hex (& want_obj -> objects [i ].item -> oid ));
229
+ oid_to_hex (& pack_data -> want_obj . objects [i ].item -> oid ));
232
230
fprintf (pipe_fd , "--not\n" );
233
- for (i = 0 ; i < have_obj -> nr ; i ++ )
231
+ for (i = 0 ; i < pack_data -> have_obj . nr ; i ++ )
234
232
fprintf (pipe_fd , "%s\n" ,
235
- oid_to_hex (& have_obj -> objects [i ].item -> oid ));
233
+ oid_to_hex (& pack_data -> have_obj . objects [i ].item -> oid ));
236
234
for (i = 0 ; i < extra_edge_obj .nr ; i ++ )
237
235
fprintf (pipe_fd , "%s\n" ,
238
236
oid_to_hex (& extra_edge_obj .objects [i ].item -> oid ));
@@ -1179,9 +1177,7 @@ void upload_pack(struct upload_pack_options *options)
1179
1177
receive_needs (& data , & reader );
1180
1178
if (data .want_obj .nr ) {
1181
1179
get_common_commits (& data , & reader );
1182
- create_pack_file (& data .have_obj ,
1183
- & data .want_obj ,
1184
- & data .filter_options );
1180
+ create_pack_file (& data );
1185
1181
}
1186
1182
}
1187
1183
@@ -1525,9 +1521,7 @@ int upload_pack_v2(struct repository *r, struct argv_array *keys,
1525
1521
send_shallow_info (& data );
1526
1522
1527
1523
packet_writer_write (& data .writer , "packfile\n" );
1528
- create_pack_file (& data .have_obj ,
1529
- & data .want_obj ,
1530
- & data .filter_options );
1524
+ create_pack_file (& data );
1531
1525
state = FETCH_DONE ;
1532
1526
break ;
1533
1527
case FETCH_DONE :
0 commit comments