builtin-help: always load_command_list() in cmd_help()
When cmd_help() is called, we always need the list of main and other commands, not just when the list of all commands is shown. Before this patch 'git help diff' invoked 'man gitdiff' because cmd_to_page() thought 'diff' is not a git command. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Miklos Vajna committed
Jul 31, 2008 at 00:38 UTC
6e4a86d2ed2d798c5462e5e324fefb8614be52a8
1 file changed
+1
-1
help.c
+1
-1
@@ -690,6 +690,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)
690
{
691
int nongit;
692
const char *alias;
693
+ unsigned int longest = load_command_list("git-", &main_cmds, &other_cmds);
694
695
setup_git_directory_gently(&nongit);
696
git_config(git_help_config, NULL);
@@ -698,7 +699,6 @@ int cmd_help(int argc, const char **argv, const char *prefix)
699
builtin_help_usage, 0);
700
701
if (show_all) {
701
- unsigned int longest = load_command_list("git-", &main_cmds, &other_cmds);
702
printf("usage: %s\n\n", git_usage_string);
703
list_commands("git commands", longest, &main_cmds, &other_cmds);
704
printf("%s\n", git_more_info_string);