MCPcopy Index your code
hub / github.com/git/git / parse_command

Function parse_command

serve.c:254–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254static int parse_command(struct repository *r, const char *key, struct protocol_capability **command)
255{
256 const char *out;
257
258 if (skip_prefix(key, "command=", &out)) {
259 const char *value;
260 struct protocol_capability *cmd = get_capability(out, &value);
261
262 if (*command)
263 die("command '%s' requested after already requesting command '%s'",
264 out, (*command)->name);
265 if (!cmd || !cmd->advertise(r, NULL) || !cmd->command || value)
266 die("invalid command '%s'", out);
267
268 *command = cmd;
269 return 1;
270 }
271
272 return 0;
273}
274
275enum request_state {
276 PROCESS_REQUEST_KEYS,

Callers 1

process_requestFunction · 0.85

Calls 2

get_capabilityFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected