Merge branch 'mt/rebase-i-keep-empty-test'
[gitweb.git] / builtin / help.c
index cc17e670ceb458491cc47e463b970b6d4c6143f8..1fdefeb6867cdd37beaf41c5fa9e113576b19f17 100644 (file)
@@ -288,6 +288,10 @@ static struct cmdnames main_cmds, other_cmds;
 
 static int is_git_command(const char *s)
 {
+       if (is_builtin(s))
+               return 1;
+
+       load_command_list("git-", &main_cmds, &other_cmds);
        return is_in_cmdlist(&main_cmds, s) ||
                is_in_cmdlist(&other_cmds, s);
 }
@@ -449,7 +453,6 @@ int cmd_help(int argc, const char **argv, const char *prefix)
        int nongit;
        const char *alias;
        enum help_format parsed_help_format;
-       load_command_list("git-", &main_cmds, &other_cmds);
 
        argc = parse_options(argc, argv, prefix, builtin_help_options,
                        builtin_help_usage, 0);
@@ -458,6 +461,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)
        if (show_all) {
                git_config(git_help_config, NULL);
                printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
+               load_command_list("git-", &main_cmds, &other_cmds);
                list_commands(colopts, &main_cmds, &other_cmds);
        }