diff options
author | Jeff King <peff@peff.net> | 2021-09-14 17:30:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-14 19:56:19 +0200 |
commit | 76804526f9795f94fb666248653a5f41ed921241 (patch) | |
tree | edb2c1e951efc78361d0aabe392a20120400faf0 /serve.c | |
parent | Merge branch 'ab/serve-cleanup' into jk/reduce-malloc-in-v2-servers (diff) | |
download | git-76804526f9795f94fb666248653a5f41ed921241.tar.xz git-76804526f9795f94fb666248653a5f41ed921241.zip |
serve: rename is_command() to parse_command()
The is_command() function not only tells us whether the pktline is a
valid command string, but it also parses out the command (and complains
if we see a duplicate). Let's rename it to make those extra functions
a bit more obvious.
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -163,7 +163,7 @@ static int is_valid_capability(const char *key) return c && c->advertise(the_repository, NULL); } -static int is_command(const char *key, struct protocol_capability **command) +static int parse_command(const char *key, struct protocol_capability **command) { const char *out; @@ -251,7 +251,7 @@ static int process_request(void) BUG("Should have already died when seeing EOF"); case PACKET_READ_NORMAL: /* collect request; a sequence of keys and values */ - if (is_command(reader.line, &command) || + if (parse_command(reader.line, &command) || is_valid_capability(reader.line)) strvec_push(&keys, reader.line); else |