@matheusbsbs / matheus-bagliano / commits / af6fbf9f81
Fork 0

help: Do not unnecessarily look for a repository

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>

David Aguilar committed Dec 1, 2009 at 11:27 UTC af6fbf9f814b3ee23b4b6d632131095c0278ae44
1 file changed +3 -3
builtin-help.c
+3 -3
@@ -427,9 +427,6 @@ 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 -
430 if (!argv[0]) {
431 printf("usage: %s\n\n", git_usage_string);
432 list_common_cmds_help();
@@ -437,6 +434,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
434 return 0;
435 }
436
437 + setup_git_directory_gently(&nongit);
438 + git_config(git_help_config, NULL);
439 +
440 alias = alias_lookup(argv[0]);
441 if (alias && !is_git_command(argv[0])) {
442 printf("`git %s' is aliased to `%s'\n", argv[0], alias);