summaryrefslogtreecommitdiff
path: root/serve.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 20:25:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-28 22:02:18 (GMT)
commitc972bf4cf546a56fe1c54ddde1d33ebb9f454a0f (patch)
tree3a97c304c0e0ed4656cc5049ba44b4eb26e87a16 /serve.c
parentef8d7ac42a6a62d678166fe25ea743315809d2bb (diff)
downloadgit-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.zip
git-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.tar.gz
git-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.tar.bz2
strvec: convert remaining 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 all of the remaining files, as the resulting diff is reasonably sized. 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; ' 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 'serve.c')
-rw-r--r--serve.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/serve.c b/serve.c
index 8d9a345..523a9be 100644
--- a/serve.c
+++ b/serve.c
@@ -56,7 +56,7 @@ struct protocol_capability {
* This field should be NULL for capabilities which are not commands.
*/
int (*command)(struct repository *r,
- struct argv_array *keys,
+ struct strvec *keys,
struct packet_reader *request);
};
@@ -142,7 +142,7 @@ static int is_command(const char *key, struct protocol_capability **command)
return 0;
}
-int has_capability(const struct argv_array *keys, const char *capability,
+int has_capability(const struct strvec *keys, const char *capability,
const char **value)
{
int i;
@@ -162,7 +162,7 @@ int has_capability(const struct argv_array *keys, const char *capability,
return 0;
}
-static void check_algorithm(struct repository *r, struct argv_array *keys)
+static void check_algorithm(struct repository *r, struct strvec *keys)
{
int client = GIT_HASH_SHA1, server = hash_algo_by_ptr(r->hash_algo);
const char *algo_name;
@@ -187,7 +187,7 @@ static int process_request(void)
{
enum request_state state = PROCESS_REQUEST_KEYS;
struct packet_reader reader;
- struct argv_array keys = ARGV_ARRAY_INIT;
+ struct strvec keys = STRVEC_INIT;
struct protocol_capability *command = NULL;
packet_reader_init(&reader, 0, NULL, 0,
@@ -211,7 +211,7 @@ static int process_request(void)
/* collect request; a sequence of keys and values */
if (is_command(reader.line, &command) ||
is_valid_capability(reader.line))
- argv_array_push(&keys, reader.line);
+ strvec_push(&keys, reader.line);
else
die("unknown capability '%s'", reader.line);
@@ -254,7 +254,7 @@ static int process_request(void)
command->command(the_repository, &keys, &reader);
- argv_array_clear(&keys);
+ strvec_clear(&keys);
return 0;
}