MCPcopy Create free account
hub / github.com/git/git / load_builtin_commands

Function load_builtin_commands

git.c:717–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715}
716
717void load_builtin_commands(const char *prefix, struct cmdnames *cmds)
718{
719 const char *name;
720
721 /*
722 * Callers can ask for a subset of the commands based on a certain
723 * prefix, which is then dropped from the added names. The names in
724 * the `commands[]` array do not have the `git-` prefix, though,
725 * therefore we must expect the `prefix` to at least start with `git-`.
726 */
727 if (!skip_prefix(prefix, "git-", &prefix))
728 BUG("prefix '%s' must start with 'git-'", prefix);
729
730 for (size_t i = 0; i < ARRAY_SIZE(commands); i++)
731 if (skip_prefix(commands[i].cmd, prefix, &name))
732 add_cmdname(cmds, name, strlen(name));
733}
734
735#ifdef STRIP_EXTENSION
736static void strip_extension(struct strvec *args)

Callers 1

load_command_listFunction · 0.70

Calls 1

add_cmdnameFunction · 0.85

Tested by

no test coverage detected