summaryrefslogtreecommitdiff
path: root/ls-refs.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 20:24:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-28 22:02:18 (GMT)
commitef8d7ac42a6a62d678166fe25ea743315809d2bb (patch)
tree41974632658fdc804d42d3c98859bd8f259828c8 /ls-refs.c
parent22f9b7f3f59549735a480042a4b9ce292eedfae0 (diff)
downloadgit-ef8d7ac42a6a62d678166fe25ea743315809d2bb.zip
git-ef8d7ac42a6a62d678166fe25ea743315809d2bb.tar.gz
git-ef8d7ac42a6a62d678166fe25ea743315809d2bb.tar.bz2
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 'ls-refs.c')
-rw-r--r--ls-refs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ls-refs.c b/ls-refs.c
index 98fb190..8192c94 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;
}