diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-08-10 10:23:57 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-08-10 10:23:57 -0700 |
| commit | 46b225f15308c8f77379f864189bed95c273d29f (patch) | |
| tree | 8f909ef2df2d002ccd2c86dc2a9dbdf4aae21c95 /pathspec.c | |
| parent | Fourth batch (diff) | |
| parent | strvec: rename struct fields (diff) | |
| download | git-46b225f15308c8f77379f864189bed95c273d29f.tar.gz git-46b225f15308c8f77379f864189bed95c273d29f.zip | |
Merge branch 'jk/strvec'
The argv_array API is useful for not just managing argv but any
"vector" (NULL-terminated array) of strings, and has seen adoption
to a certain degree. It has been renamed to "strvec" to reduce the
barrier to adoption.
* jk/strvec:
strvec: rename struct fields
strvec: drop argv_array compatibility layer
strvec: update documention to avoid argv_array
strvec: fix indentation in renamed calls
strvec: convert remaining callers away from argv_array name
strvec: convert more callers away from argv_array name
strvec: convert builtin/ callers away from argv_array name
quote: rename sq_dequote_to_argv_array to mention strvec
strvec: rename files from argv-array to strvec
argv-array: rename to strvec
argv-array: use size_t for count and alloc
Diffstat (limited to 'pathspec.c')
| -rw-r--r-- | pathspec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pathspec.c b/pathspec.c index 8243e06eab..7a229d8d22 100644 --- a/pathspec.c +++ b/pathspec.c @@ -3,7 +3,7 @@ #include "dir.h" #include "pathspec.h" #include "attr.h" -#include "argv-array.h" +#include "strvec.h" #include "quote.h" /* @@ -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); } @@ -652,8 +652,8 @@ void parse_pathspec_file(struct pathspec *pathspec, unsigned magic_mask, if (in != stdin) fclose(in); - parse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.argv); - argv_array_clear(&parsed_file); + parse_pathspec(pathspec, magic_mask, flags, prefix, parsed_file.v); + strvec_clear(&parsed_file); } void copy_pathspec(struct pathspec *dst, const struct pathspec *src) |
