]> git.ipfire.org Git - thirdparty/git.git/commitdiff
serve: rename is_command() to parse_command()
authorJeff King <peff@peff.net>
Tue, 14 Sep 2021 15:30:20 +0000 (11:30 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 Sep 2021 17:56:19 +0000 (10:56 -0700)
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>
serve.c

diff --git a/serve.c b/serve.c
index 1817edc7f57a30492a60a814ae5507b718ecb87f..fd88b95343365bdf132c11b33883f33eaf65fdb6 100644 (file)
--- a/serve.c
+++ b/serve.c
@@ -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