summary refs log tree commit diff
path: root/commit.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 16:24:53 -0400
committerJunio C Hamano <gitster@pobox.com>2020-07-28 15:02:18 -0700
commitef8d7ac42a6a62d678166fe25ea743315809d2bb (patch)
tree41974632658fdc804d42d3c98859bd8f259828c8 /commit.c
parent22f9b7f3f59549735a480042a4b9ce292eedfae0 (diff)
strvec: convert more 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 remaining files from the first half of the alphabet,
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 '[abcdefghjkl]*'".
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 'commit.c')
-rw-r--r--commit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/commit.c b/commit.c
index 7128895c3a..a5176a25bd 100644
--- a/commit.c
+++ b/commit.c
@@ -1630,22 +1630,22 @@ size_t ignore_non_trailer(const char *buf, size_t len)
 int run_commit_hook(int editor_is_used, const char *index_file,
 		    const char *name, ...)
 {
-	struct argv_array hook_env = ARGV_ARRAY_INIT;
+	struct strvec hook_env = STRVEC_INIT;
 	va_list args;
 	int ret;
 
-	argv_array_pushf(&hook_env, "GIT_INDEX_FILE=%s", index_file);
+	strvec_pushf(&hook_env, "GIT_INDEX_FILE=%s", index_file);
 
 	/*
 	 * Let the hook know that no editor will be launched.
 	 */
 	if (!editor_is_used)
-		argv_array_push(&hook_env, "GIT_EDITOR=:");
+		strvec_push(&hook_env, "GIT_EDITOR=:");
 
 	va_start(args, name);
 	ret = run_hook_ve(hook_env.argv,name, args);
 	va_end(args);
-	argv_array_clear(&hook_env);
+	strvec_clear(&hook_env);
 
 	return ret;
 }