Skip to content

Commit 7680452

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0057847 commit 7680452

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

serve.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int is_valid_capability(const char *key)
163163
return c && c->advertise(the_repository, NULL);
164164
}
165165

166-
static int is_command(const char *key, struct protocol_capability **command)
166+
static int parse_command(const char *key, struct protocol_capability **command)
167167
{
168168
const char *out;
169169

@@ -251,7 +251,7 @@ static int process_request(void)
251251
BUG("Should have already died when seeing EOF");
252252
case PACKET_READ_NORMAL:
253253
/* collect request; a sequence of keys and values */
254-
if (is_command(reader.line, &command) ||
254+
if (parse_command(reader.line, &command) ||
255255
is_valid_capability(reader.line))
256256
strvec_push(&keys, reader.line);
257257
else

0 commit comments

Comments
 (0)