@@ -116,7 +116,7 @@ struct am_state {
116
116
int keep ; /* enum keep_type */
117
117
int message_id ;
118
118
int scissors ; /* enum scissors_type */
119
- struct argv_array git_apply_opts ;
119
+ struct strvec git_apply_opts ;
120
120
const char * resolvemsg ;
121
121
int committer_date_is_author_date ;
122
122
int ignore_date ;
@@ -146,7 +146,7 @@ static void am_state_init(struct am_state *state)
146
146
147
147
state -> scissors = SCISSORS_UNSET ;
148
148
149
- argv_array_init (& state -> git_apply_opts );
149
+ strvec_init (& state -> git_apply_opts );
150
150
151
151
if (!git_config_get_bool ("commit.gpgsign" , & gpgsign ))
152
152
state -> sign_commit = gpgsign ? "" : NULL ;
@@ -162,7 +162,7 @@ static void am_state_release(struct am_state *state)
162
162
free (state -> author_email );
163
163
free (state -> author_date );
164
164
free (state -> msg );
165
- argv_array_clear (& state -> git_apply_opts );
165
+ strvec_clear (& state -> git_apply_opts );
166
166
}
167
167
168
168
/**
@@ -398,7 +398,7 @@ static void am_load(struct am_state *state)
398
398
state -> scissors = SCISSORS_UNSET ;
399
399
400
400
read_state_file (& sb , state , "apply-opt" , 1 );
401
- argv_array_clear (& state -> git_apply_opts );
401
+ strvec_clear (& state -> git_apply_opts );
402
402
if (sq_dequote_to_strvec (sb .buf , & state -> git_apply_opts ) < 0 )
403
403
die (_ ("could not parse %s" ), am_path (state , "apply-opt" ));
404
404
@@ -452,8 +452,8 @@ static int run_post_rewrite_hook(const struct am_state *state)
452
452
if (!hook )
453
453
return 0 ;
454
454
455
- argv_array_push (& cp .args , hook );
456
- argv_array_push (& cp .args , "rebase" );
455
+ strvec_push (& cp .args , hook );
456
+ strvec_push (& cp .args , "rebase" );
457
457
458
458
cp .in = xopen (am_path (state , "rewritten" ), O_RDONLY );
459
459
cp .stdout_to_stderr = 1 ;
@@ -651,16 +651,16 @@ static int split_mail_mbox(struct am_state *state, const char **paths,
651
651
int ret ;
652
652
653
653
cp .git_cmd = 1 ;
654
- argv_array_push (& cp .args , "mailsplit" );
655
- argv_array_pushf (& cp .args , "-d%d" , state -> prec );
656
- argv_array_pushf (& cp .args , "-o%s" , state -> dir );
657
- argv_array_push (& cp .args , "-b" );
654
+ strvec_push (& cp .args , "mailsplit" );
655
+ strvec_pushf (& cp .args , "-d%d" , state -> prec );
656
+ strvec_pushf (& cp .args , "-o%s" , state -> dir );
657
+ strvec_push (& cp .args , "-b" );
658
658
if (keep_cr )
659
- argv_array_push (& cp .args , "--keep-cr" );
659
+ strvec_push (& cp .args , "--keep-cr" );
660
660
if (mboxrd )
661
- argv_array_push (& cp .args , "--mboxrd" );
662
- argv_array_push (& cp .args , "--" );
663
- argv_array_pushv (& cp .args , paths );
661
+ strvec_push (& cp .args , "--mboxrd" );
662
+ strvec_push (& cp .args , "--" );
663
+ strvec_pushv (& cp .args , paths );
664
664
665
665
ret = capture_command (& cp , & last , 8 );
666
666
if (ret )
@@ -787,7 +787,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
787
787
const char * series_dir ;
788
788
char * series_dir_buf ;
789
789
FILE * fp ;
790
- struct argv_array patches = ARGV_ARRAY_INIT ;
790
+ struct strvec patches = STRVEC_INIT ;
791
791
struct strbuf sb = STRBUF_INIT ;
792
792
int ret ;
793
793
@@ -805,7 +805,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
805
805
if (* sb .buf == '#' )
806
806
continue ; /* skip comment lines */
807
807
808
- argv_array_push (& patches , mkpath ("%s/%s" , series_dir , sb .buf ));
808
+ strvec_push (& patches , mkpath ("%s/%s" , series_dir , sb .buf ));
809
809
}
810
810
811
811
fclose (fp );
@@ -814,7 +814,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
814
814
815
815
ret = split_mail_conv (stgit_patch_to_mail , state , patches .argv , keep_cr );
816
816
817
- argv_array_clear (& patches );
817
+ strvec_clear (& patches );
818
818
return ret ;
819
819
}
820
820
@@ -1390,8 +1390,8 @@ static int parse_mail_rebase(struct am_state *state, const char *mail)
1390
1390
*/
1391
1391
static int run_apply (const struct am_state * state , const char * index_file )
1392
1392
{
1393
- struct argv_array apply_paths = ARGV_ARRAY_INIT ;
1394
- struct argv_array apply_opts = ARGV_ARRAY_INIT ;
1393
+ struct strvec apply_paths = STRVEC_INIT ;
1394
+ struct strvec apply_opts = STRVEC_INIT ;
1395
1395
struct apply_state apply_state ;
1396
1396
int res , opts_left ;
1397
1397
int force_apply = 0 ;
@@ -1400,8 +1400,8 @@ static int run_apply(const struct am_state *state, const char *index_file)
1400
1400
if (init_apply_state (& apply_state , the_repository , NULL ))
1401
1401
BUG ("init_apply_state() failed" );
1402
1402
1403
- argv_array_push (& apply_opts , "apply" );
1404
- argv_array_pushv (& apply_opts , state -> git_apply_opts .argv );
1403
+ strvec_push (& apply_opts , "apply" );
1404
+ strvec_pushv (& apply_opts , state -> git_apply_opts .argv );
1405
1405
1406
1406
opts_left = apply_parse_options (apply_opts .argc , apply_opts .argv ,
1407
1407
& apply_state , & force_apply , & options ,
@@ -1426,12 +1426,12 @@ static int run_apply(const struct am_state *state, const char *index_file)
1426
1426
if (check_apply_state (& apply_state , force_apply ))
1427
1427
BUG ("check_apply_state() failed" );
1428
1428
1429
- argv_array_push (& apply_paths , am_path (state , "patch" ));
1429
+ strvec_push (& apply_paths , am_path (state , "patch" ));
1430
1430
1431
1431
res = apply_all_patches (& apply_state , apply_paths .argc , apply_paths .argv , options );
1432
1432
1433
- argv_array_clear (& apply_paths );
1434
- argv_array_clear (& apply_opts );
1433
+ strvec_clear (& apply_paths );
1434
+ strvec_clear (& apply_opts );
1435
1435
clear_apply_state (& apply_state );
1436
1436
1437
1437
if (res )
@@ -1454,10 +1454,10 @@ static int build_fake_ancestor(const struct am_state *state, const char *index_f
1454
1454
struct child_process cp = CHILD_PROCESS_INIT ;
1455
1455
1456
1456
cp .git_cmd = 1 ;
1457
- argv_array_push (& cp .args , "apply" );
1458
- argv_array_pushv (& cp .args , state -> git_apply_opts .argv );
1459
- argv_array_pushf (& cp .args , "--build-fake-ancestor=%s" , index_file );
1460
- argv_array_push (& cp .args , am_path (state , "patch" ));
1457
+ strvec_push (& cp .args , "apply" );
1458
+ strvec_pushv (& cp .args , state -> git_apply_opts .argv );
1459
+ strvec_pushf (& cp .args , "--build-fake-ancestor=%s" , index_file );
1460
+ strvec_push (& cp .args , am_path (state , "patch" ));
1461
1461
1462
1462
if (run_command (& cp ))
1463
1463
return -1 ;
@@ -1676,7 +1676,7 @@ static int do_interactive(struct am_state *state)
1676
1676
if (!pager )
1677
1677
pager = "cat" ;
1678
1678
prepare_pager_args (& cp , pager );
1679
- argv_array_push (& cp .args , am_path (state , "patch" ));
1679
+ strvec_push (& cp .args , am_path (state , "patch" ));
1680
1680
run_command (& cp );
1681
1681
}
1682
1682
}
@@ -2346,7 +2346,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2346
2346
if (state .signoff == SIGNOFF_EXPLICIT )
2347
2347
am_append_signoff (& state );
2348
2348
} else {
2349
- struct argv_array paths = ARGV_ARRAY_INIT ;
2349
+ struct strvec paths = STRVEC_INIT ;
2350
2350
int i ;
2351
2351
2352
2352
/*
@@ -2371,17 +2371,17 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2371
2371
2372
2372
for (i = 0 ; i < argc ; i ++ ) {
2373
2373
if (is_absolute_path (argv [i ]) || !prefix )
2374
- argv_array_push (& paths , argv [i ]);
2374
+ strvec_push (& paths , argv [i ]);
2375
2375
else
2376
- argv_array_push (& paths , mkpath ("%s/%s" , prefix , argv [i ]));
2376
+ strvec_push (& paths , mkpath ("%s/%s" , prefix , argv [i ]));
2377
2377
}
2378
2378
2379
2379
if (state .interactive && !paths .argc )
2380
2380
die (_ ("interactive mode requires patches on the command line" ));
2381
2381
2382
2382
am_setup (& state , patch_format , paths .argv , keep_cr );
2383
2383
2384
- argv_array_clear (& paths );
2384
+ strvec_clear (& paths );
2385
2385
}
2386
2386
2387
2387
switch (resume .mode ) {
0 commit comments