Skip to content

Commit

Permalink
help: Do not unnecessarily look for a repository
Browse files Browse the repository at this point in the history
Although 'git help' actually doesn't need to be run inside a git
repository and uses no repository-specific information, it looks for a git
directory.  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 without any options.

7c3baa9 originally modified 'git help -a' to not require a repository.
This applies the same fix for 'git help'.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
David Aguilar authored and Junio C Hamano committed Dec 1, 2009
1 parent 3c652d1 commit af6fbf9
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 @@ -427,16 +427,16 @@ 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();
printf("\n%s\n", git_more_info_string);
return 0;
}

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

alias = alias_lookup(argv[0]);
if (alias && !is_git_command(argv[0])) {
printf("`git %s' is aliased to `%s'\n", argv[0], alias);
Expand Down

0 comments on commit af6fbf9

Please sign in to comment.