| 715 | } |
| 716 | |
| 717 | void 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 |
| 736 | static void strip_extension(struct strvec *args) |
no test coverage detected