strvec: convert builtin/ 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 files in builtin/ to keep the diff to a
manageable size.
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;
'
and then selectively staging files with "git add builtin/". 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
2745b6b450
commit
22f9b7f3f5
@ -19,7 +19,7 @@ static const char deadchild[] =
|
||||
|
||||
int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
struct argv_array sent_argv = ARGV_ARRAY_INIT;
|
||||
struct strvec sent_argv = STRVEC_INIT;
|
||||
const char *arg_cmd = "argument ";
|
||||
|
||||
if (argc != 2 || !strcmp(argv[1], "-h"))
|
||||
@ -31,7 +31,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
|
||||
init_archivers();
|
||||
|
||||
/* put received options in sent_argv[] */
|
||||
argv_array_push(&sent_argv, "git-upload-archive");
|
||||
strvec_push(&sent_argv, "git-upload-archive");
|
||||
for (;;) {
|
||||
char *buf = packet_read_line(0, NULL);
|
||||
if (!buf)
|
||||
@ -41,7 +41,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
|
||||
|
||||
if (!starts_with(buf, arg_cmd))
|
||||
die("'argument' token or flush expected");
|
||||
argv_array_push(&sent_argv, buf + strlen(arg_cmd));
|
||||
strvec_push(&sent_argv, buf + strlen(arg_cmd));
|
||||
}
|
||||
|
||||
/* parse all options sent by the client */
|
||||
|
||||
Reference in New Issue
Block a user