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

@ -8,7 +8,7 @@
#include "diffcore.h"
#include "quote.h"
#include "run-command.h"
#include "argv-array.h"
#include "strvec.h"
#include "remote.h"
#include "refs.h"
#include "submodule.h"
@ -913,17 +913,16 @@ static void wt_longstatus_print_submodule_summary(struct wt_status *s, int uncom
struct strbuf summary = STRBUF_INIT;
char *summary_content;
argv_array_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s",
s->index_file);
strvec_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s", s->index_file);
argv_array_push(&sm_summary.args, "submodule");
argv_array_push(&sm_summary.args, "summary");
argv_array_push(&sm_summary.args, uncommitted ? "--files" : "--cached");
argv_array_push(&sm_summary.args, "--for-status");
argv_array_push(&sm_summary.args, "--summary-limit");
argv_array_pushf(&sm_summary.args, "%d", s->submodule_summary);
strvec_push(&sm_summary.args, "submodule");
strvec_push(&sm_summary.args, "summary");
strvec_push(&sm_summary.args, uncommitted ? "--files" : "--cached");
strvec_push(&sm_summary.args, "--for-status");
strvec_push(&sm_summary.args, "--summary-limit");
strvec_pushf(&sm_summary.args, "%d", s->submodule_summary);
if (!uncommitted)
argv_array_push(&sm_summary.args, s->amend ? "HEAD^" : "HEAD");
strvec_push(&sm_summary.args, s->amend ? "HEAD^" : "HEAD");
sm_summary.git_cmd = 1;
sm_summary.no_stdin = 1;