strvec: convert remaining callers away from argv_array name
We eventually want to drop the argv_array name and just use strvec
consistently. There's no particular reason we have to do it all at once,
or care about interactions between converted and unconverted bits.
Because of our preprocessor compat layer, the names are interchangeable
to the compiler (so even a definition and declaration using different
names is OK).
This patch converts all of the remaining files, as the resulting diff is
reasonably sized.
The conversion was done purely mechanically with:
git ls-files '*.c' '*.h' |
xargs perl -i -pe '
s/ARGV_ARRAY/STRVEC/g;
s/argv_array/strvec/g;
'
We'll deal with any indentation/style fallouts separately.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
ef8d7ac42a
commit
c972bf4cf5
12
remote.c
12
remote.c
@ -1885,7 +1885,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,
|
||||
struct object_id oid;
|
||||
struct commit *ours, *theirs;
|
||||
struct rev_info revs;
|
||||
struct argv_array argv = ARGV_ARRAY_INIT;
|
||||
struct strvec argv = STRVEC_INIT;
|
||||
|
||||
/* Cannot stat if what we used to build on no longer exists */
|
||||
if (read_ref(base, &oid))
|
||||
@ -1911,12 +1911,12 @@ static int stat_branch_pair(const char *branch_name, const char *base,
|
||||
BUG("stat_branch_pair: invalid abf '%d'", abf);
|
||||
|
||||
/* Run "rev-list --left-right ours...theirs" internally... */
|
||||
argv_array_push(&argv, ""); /* ignored */
|
||||
argv_array_push(&argv, "--left-right");
|
||||
argv_array_pushf(&argv, "%s...%s",
|
||||
strvec_push(&argv, ""); /* ignored */
|
||||
strvec_push(&argv, "--left-right");
|
||||
strvec_pushf(&argv, "%s...%s",
|
||||
oid_to_hex(&ours->object.oid),
|
||||
oid_to_hex(&theirs->object.oid));
|
||||
argv_array_push(&argv, "--");
|
||||
strvec_push(&argv, "--");
|
||||
|
||||
repo_init_revisions(the_repository, &revs, NULL);
|
||||
setup_revisions(argv.argc, argv.argv, &revs, NULL);
|
||||
@ -1938,7 +1938,7 @@ static int stat_branch_pair(const char *branch_name, const char *base,
|
||||
clear_commit_marks(ours, ALL_REV_FLAGS);
|
||||
clear_commit_marks(theirs, ALL_REV_FLAGS);
|
||||
|
||||
argv_array_clear(&argv);
|
||||
strvec_clear(&argv);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user