quote: drop sq_dequote_to_argv()

The last caller went away in f9dbb64fad (config: parse more robust format in GIT_CONFIG_PARAMETERS, 2021-01-12), when we switched to using sq_dequote_step(). The "to_argv()" form is not a great interface. If you care about raw speed, then sq_dequote_step() lets you work incrementally without extra allocations. If you care about simplicity, then sq_dequote_to_strvec() puts the result in an encapsulated data structure. With sq_dequote_to_argv(), you have a data dependency on the original string but still have to remember to manually free the argv array itself (but not its elements). So it's sort of a worst-of-both-worlds middle ground. Let's get rid of it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed May 18, 2026 at 21:19 UTC c5f52d03e223e1ea0c4639d22ad1ca180ec85097
2 files changed +3 -14
quote.c
-5
@@ -202,11 +202,6 @@ static int sq_dequote_to_argv_internal(char *arg,
202 return 0;
203 }
204
205 -int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc)
206 -{
207 - return sq_dequote_to_argv_internal(arg, argv, nr, alloc, NULL);
208 -}
209 -
205 int sq_dequote_to_strvec(char *arg, struct strvec *array)
206 {
207 return sq_dequote_to_argv_internal(arg, NULL, NULL, NULL, array);
quote.h
+3 -9
@@ -68,15 +68,9 @@ char *sq_dequote_step(char *src, char **next);
68
69 /*
70 * Same as the above, but can be used to unwrap many arguments in the
71 - * same string separated by space. Like sq_quote, it works in place,
72 - * modifying arg and appending pointers into it to argv.
73 - */
74 -int sq_dequote_to_argv(char *arg, const char ***argv, int *nr, int *alloc);
75 -
76 -/*
77 - * Same as above, but store the unquoted strings in a strvec. We will
78 - * still modify arg in place, but unlike sq_dequote_to_argv, the strvec
79 - * will duplicate and take ownership of the strings.
71 + * same string separated by space. The strvec will duplicate and take
72 + * ownership of the strings, but note that "arg" is still modified in-place
73 + * during parsing.
74 */
75 int sq_dequote_to_strvec(char *arg, struct strvec *);
76