@matheusbsbs / matheus-bagliano / commits / 7c3baa9abf
Fork 0

help -a: do not unnecessarily look for a repository

Although 'git help -a' actually doesn't need to be run inside a git repository and uses no repository-specific information, it looks for a git directory. On 'git <TAB><TAB>' the bash completion runs 'git help -a' and unnecessary searching for a git directory can be annoying in auto-mount environments. With this commit, 'git help' no longer searches for a repository when run with the -a option. Reported by Vincent Danjean through http://bugs.debian.org/539273 Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Sep 4, 2009 at 12:22 UTC 7c3baa9abf0abe15f068d95688bbc27e73a69042
1 file changed +3 -3
builtin-help.c
+3 -3
@@ -417,9 +417,6 @@ int cmd_help(int argc, const char **argv, const char *prefix)
417 const char *alias;
418 load_command_list("git-", &main_cmds, &other_cmds);
419
420 - setup_git_directory_gently(&nongit);
421 - git_config(git_help_config, NULL);
422 -
420 argc = parse_options(argc, argv, prefix, builtin_help_options,
421 builtin_help_usage, 0);
422
@@ -430,6 +427,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
427 return 0;
428 }
429
430 + setup_git_directory_gently(&nongit);
431 + git_config(git_help_config, NULL);
432 +
433 if (!argv[0]) {
434 printf("usage: %s\n\n", git_usage_string);
435 list_common_cmds_help();