Skip to content

Commit 7c3baa9

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Gerrit Pape <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aab7486 commit 7c3baa9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin-help.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,6 @@ int cmd_help(int argc, const char **argv, const char *prefix)
417417
const char *alias;
418418
load_command_list("git-", &main_cmds, &other_cmds);
419419

420-
setup_git_directory_gently(&nongit);
421-
git_config(git_help_config, NULL);
422-
423420
argc = parse_options(argc, argv, prefix, builtin_help_options,
424421
builtin_help_usage, 0);
425422

@@ -430,6 +427,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
430427
return 0;
431428
}
432429

430+
setup_git_directory_gently(&nongit);
431+
git_config(git_help_config, NULL);
432+
433433
if (!argv[0]) {
434434
printf("usage: %s\n\n", git_usage_string);
435435
list_common_cmds_help();

0 commit comments

Comments
 (0)