Skip to content

Commit

Permalink
help -a: do not unnecessarily look for a repository
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dscho authored and gitster committed Oct 28, 2009
1 parent aab7486 commit 7c3baa9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin-help.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,6 @@ int cmd_help(int argc, const char **argv, const char *prefix)
const char *alias;
load_command_list("git-", &main_cmds, &other_cmds);

setup_git_directory_gently(&nongit);
git_config(git_help_config, NULL);

argc = parse_options(argc, argv, prefix, builtin_help_options,
builtin_help_usage, 0);

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

setup_git_directory_gently(&nongit);
git_config(git_help_config, NULL);

if (!argv[0]) {
printf("usage: %s\n\n", git_usage_string);
list_common_cmds_help();
Expand Down

0 comments on commit 7c3baa9

Please sign in to comment.