Restore use of 'help.format' configuration property in 'git help'

Commit 1cc8af0 "help: use HTML as the default help format on Windows" lost the ability to make use of the help.format config value by forcing the use of a compiled in default if no command-line argument was provided. This commit restores the use of the help.format value if one is available, overriding the compiled default. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pat Thoyts committed Jun 22, 2012 at 13:48 UTC d0408c0c8cd636233f01c0bda9ad71161609297c
1 file changed +3 -3
builtin/help.c
+3 -3
@@ -449,10 +449,10 @@ int cmd_help(int argc, const char **argv, const char *prefix)
449 setup_git_directory_gently(&nongit);
450 git_config(git_help_config, NULL);
451
452 - if (parsed_help_format == HELP_FORMAT_NONE)
453 - help_format = parse_help_format(DEFAULT_HELP_FORMAT);
454 - else
452 + if (parsed_help_format != HELP_FORMAT_NONE)
453 help_format = parsed_help_format;
454 + if (help_format == HELP_FORMAT_NONE)
455 + help_format = parse_help_format(DEFAULT_HELP_FORMAT);
456
457 alias = alias_lookup(argv[0]);
458 if (alias && !is_git_command(argv[0])) {