From ef8d7ac42a6a62d678166fe25ea743315809d2bb Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 28 Jul 2020 16:24:53 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- ls-refs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ls-refs.c') diff --git a/ls-refs.c b/ls-refs.c index 98fb19092a..8192c949f4 100644 --- a/ls-refs.c +++ b/ls-refs.c @@ -11,7 +11,7 @@ * Check if one of the prefixes is a prefix of the ref. * If no prefixes were provided, all refs match. */ -static int ref_match(const struct argv_array *prefixes, const char *refname) +static int ref_match(const struct strvec *prefixes, const char *refname) { int i; @@ -31,7 +31,7 @@ static int ref_match(const struct argv_array *prefixes, const char *refname) struct ls_refs_data { unsigned peel; unsigned symrefs; - struct argv_array prefixes; + struct strvec prefixes; }; static int send_ref(const char *refname, const struct object_id *oid, @@ -84,7 +84,7 @@ static int ls_refs_config(const char *var, const char *value, void *data) return parse_hide_refs_config(var, value, "uploadpack"); } -int ls_refs(struct repository *r, struct argv_array *keys, +int ls_refs(struct repository *r, struct strvec *keys, struct packet_reader *request) { struct ls_refs_data data; @@ -102,7 +102,7 @@ int ls_refs(struct repository *r, struct argv_array *keys, else if (!strcmp("symrefs", arg)) data.symrefs = 1; else if (skip_prefix(arg, "ref-prefix ", &out)) - argv_array_push(&data.prefixes, out); + strvec_push(&data.prefixes, out); } if (request->status != PACKET_READ_FLUSH) @@ -111,6 +111,6 @@ int ls_refs(struct repository *r, struct argv_array *keys, head_ref_namespaced(send_ref, &data); for_each_namespaced_ref(send_ref, &data); packet_flush(1); - argv_array_clear(&data.prefixes); + strvec_clear(&data.prefixes); return 0; } -- cgit v1.2.3