summaryrefslogtreecommitdiff
path: root/builtin/upload-archive.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 16:24:27 -0400
committerJunio C Hamano <gitster@pobox.com>2020-07-28 15:02:18 -0700
commit22f9b7f3f59549735a480042a4b9ce292eedfae0 (patch)
treeaf564ca6084c9790ea99dd60291d7aa9f854fecb /builtin/upload-archive.c
parent2745b6b4505ae11d6821c1d451169727b558a079 (diff)
downloadgit-22f9b7f3f59549735a480042a4b9ce292eedfae0.tar.gz
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>
Diffstat (limited to 'builtin/upload-archive.c')
-rw-r--r--builtin/upload-archive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index 7fc8e0e82d..f02bb0ea15 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -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 */