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
This commit is contained in:
Junio C Hamano
2020-08-10 10:23:57 -07:00
105 changed files with 1619 additions and 1620 deletions

View File

@ -4,7 +4,7 @@
#include "bisect.h"
#include "refs.h"
#include "dir.h"
#include "argv-array.h"
#include "strvec.h"
#include "run-command.h"
#include "prompt.h"
#include "quote.h"
@ -164,18 +164,18 @@ static int bisect_reset(const char *commit)
}
if (!ref_exists("BISECT_HEAD")) {
struct argv_array argv = ARGV_ARRAY_INIT;
struct strvec argv = STRVEC_INIT;
argv_array_pushl(&argv, "checkout", branch.buf, "--", NULL);
if (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {
strvec_pushl(&argv, "checkout", branch.buf, "--", NULL);
if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
error(_("could not check out original"
" HEAD '%s'. Try 'git bisect"
" reset <commit>'."), branch.buf);
strbuf_release(&branch);
argv_array_clear(&argv);
strvec_clear(&argv);
return -1;
}
argv_array_clear(&argv);
strvec_clear(&argv);
}
strbuf_release(&branch);
@ -525,11 +525,11 @@ static int bisect_start(struct bisect_terms *terms, int no_checkout,
strbuf_read_file(&start_head, git_path_bisect_start(), 0);
strbuf_trim(&start_head);
if (!no_checkout) {
struct argv_array argv = ARGV_ARRAY_INIT;
struct strvec argv = STRVEC_INIT;
argv_array_pushl(&argv, "checkout", start_head.buf,
"--", NULL);
if (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {
strvec_pushl(&argv, "checkout", start_head.buf,
"--", NULL);
if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
res = error(_("checking out '%s' failed."
" Try 'git bisect start "
"<valid-branch>'."),