Skip to content

Commit 2745b6b

Browse files
peffgitster
authored andcommitted
quote: rename sq_dequote_to_argv_array to mention strvec
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dbbcd44 commit 2745b6b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

bisect.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ static void read_bisect_paths(struct argv_array *array)
464464

465465
while (strbuf_getline_lf(&str, fp) != EOF) {
466466
strbuf_trim(&str);
467-
if (sq_dequote_to_argv_array(str.buf, array))
467+
if (sq_dequote_to_strvec(str.buf, array))
468468
die(_("Badly quoted content in file '%s': %s"),
469469
filename, str.buf);
470470
}

builtin/am.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static void am_load(struct am_state *state)
399399

400400
read_state_file(&sb, state, "apply-opt", 1);
401401
argv_array_clear(&state->git_apply_opts);
402-
if (sq_dequote_to_argv_array(sb.buf, &state->git_apply_opts) < 0)
402+
if (sq_dequote_to_strvec(sb.buf, &state->git_apply_opts) < 0)
403403
die(_("could not parse %s"), am_path(state, "apply-opt"));
404404

405405
state->rebasing = !!file_exists(am_path(state, "rebasing"));

quote.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc)
198198
return sq_dequote_to_argv_internal(arg, argv, nr, alloc, NULL);
199199
}
200200

201-
int sq_dequote_to_argv_array(char *arg, struct argv_array *array)
201+
int sq_dequote_to_strvec(char *arg, struct strvec *array)
202202
{
203203
return sq_dequote_to_argv_internal(arg, NULL, NULL, NULL, array);
204204
}

quote.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ char *sq_dequote(char *);
5656
int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc);
5757

5858
/*
59-
* Same as above, but store the unquoted strings in an argv_array. We will
60-
* still modify arg in place, but unlike sq_dequote_to_argv, the argv_array
59+
* Same as above, but store the unquoted strings in a strvec. We will
60+
* still modify arg in place, but unlike sq_dequote_to_argv, the strvec
6161
* will duplicate and take ownership of the strings.
6262
*/
6363
struct strvec;
64-
int sq_dequote_to_argv_array(char *arg, struct strvec *);
64+
int sq_dequote_to_strvec(char *arg, struct strvec *);
6565

6666
int unquote_c_style(struct strbuf *, const char *quoted, const char **endp);
6767
size_t quote_c_style(const char *name, struct strbuf *, FILE *, int no_dq);

0 commit comments

Comments
 (0)