summaryrefslogtreecommitdiff
path: root/pathspec.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2020-07-28 16:25:12 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-07-28 15:02:18 -0700
commitc972bf4cf546a56fe1c54ddde1d33ebb9f454a0f (patch)
tree3a97c304c0e0ed4656cc5049ba44b4eb26e87a16 /pathspec.c
parentstrvec: convert more callers away from argv_array name (diff)
downloadtgif-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.tar.xz
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>
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pathspec.c b/pathspec.c
index 57c9b58418..c303126f37 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -624,7 +624,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,
unsigned flags, const char *prefix,
const char *file, int nul_term_line)
{
- struct argv_array parsed_file = ARGV_ARRAY_INIT;
+ struct strvec parsed_file = STRVEC_INIT;
strbuf_getline_fn getline_fn = nul_term_line ? strbuf_getline_nul :
strbuf_getline;
struct strbuf buf = STRBUF_INIT;
@@ -643,7 +643,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,
die(_("line is badly quoted: %s"), buf.buf);
strbuf_swap(&buf, &unquoted);
}
- argv_array_push(&parsed_file, buf.buf);
+ strvec_push(&parsed_file, buf.buf);
strbuf_reset(&buf);
}
@@ -653,7 +653,7 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask,
fclose(in);
parse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.argv);
- argv_array_clear(&parsed_file);
+ strvec_clear(&parsed_file);
}
void copy_pathspec(struct pathspec *dst, const struct pathspec *src)