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>
This commit is contained in:

committed by
Junio C Hamano

parent
ef8d7ac42a
commit
c972bf4cf5
12
serve.c
12
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user