]> git.ipfire.org Git - thirdparty/git.git/commitdiff
quote: rename sq_dequote_to_argv_array to mention strvec
authorJeff King <peff@peff.net>
Tue, 28 Jul 2020 20:24:02 +0000 (16:24 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Jul 2020 22:02:18 +0000 (15:02 -0700)
We want to eventually drop the use of the "argv_array" name in favor of
"strvec." Unlike most other uses of the name, this one is embedded in a
function name, so the definition and all of the callers need to be
updated at the same time.

We don't technically need to update the parameter types here (our
preprocessor compat macros make the two names interchangeable), but
let's do so to keep the site consistent for now.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bisect.c
builtin/am.c
quote.c
quote.h

index 3160e82e961aee07c2dbf1ed0971b7fb18830421..77e35ddd439103bcd25b989c698033425c12ca54 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -464,7 +464,7 @@ static void read_bisect_paths(struct argv_array *array)
 
        while (strbuf_getline_lf(&str, fp) != EOF) {
                strbuf_trim(&str);
-               if (sq_dequote_to_argv_array(str.buf, array))
+               if (sq_dequote_to_strvec(str.buf, array))
                        die(_("Badly quoted content in file '%s': %s"),
                            filename, str.buf);
        }
index 69e50de018ba01cb2243221f1c7b5d7617afc72d..0641316e35dcb7eb08a47703f7a4e5c74daccc98 100644 (file)
@@ -399,7 +399,7 @@ static void am_load(struct am_state *state)
 
        read_state_file(&sb, state, "apply-opt", 1);
        argv_array_clear(&state->git_apply_opts);
-       if (sq_dequote_to_argv_array(sb.buf, &state->git_apply_opts) < 0)
+       if (sq_dequote_to_strvec(sb.buf, &state->git_apply_opts) < 0)
                die(_("could not parse %s"), am_path(state, "apply-opt"));
 
        state->rebasing = !!file_exists(am_path(state, "rebasing"));
diff --git a/quote.c b/quote.c
index dac8b4e55eaa49a8b5afb3e623f4d021fbc532b9..10b383cc1d967ce5cdc656a4201db5db402abbb7 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -198,7 +198,7 @@ int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc)
        return sq_dequote_to_argv_internal(arg, argv, nr, alloc, NULL);
 }
 
-int sq_dequote_to_argv_array(char *arg, struct argv_array *array)
+int sq_dequote_to_strvec(char *arg, struct strvec *array)
 {
        return sq_dequote_to_argv_internal(arg, NULL, NULL, NULL, array);
 }
diff --git a/quote.h b/quote.h
index 210d5802292e8d02086ef5620d8528e06ff71036..fa09309cf6890fa82b4034dcdf957a59e0339d14 100644 (file)
--- a/quote.h
+++ b/quote.h
@@ -56,12 +56,12 @@ char *sq_dequote(char *);
 int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc);
 
 /*
- * Same as above, but store the unquoted strings in an argv_array. We will
- * still modify arg in place, but unlike sq_dequote_to_argv, the argv_array
+ * Same as above, but store the unquoted strings in a strvec. We will
+ * still modify arg in place, but unlike sq_dequote_to_argv, the strvec
  * will duplicate and take ownership of the strings.
  */
 struct strvec;
-int sq_dequote_to_argv_array(char *arg, struct strvec *);
+int sq_dequote_to_strvec(char *arg, struct strvec *);
 
 int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);
 size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq);