Skip to content

Commit

Permalink
builtin-help: silently tolerate unknown keys
Browse files Browse the repository at this point in the history
If for some reason the config file contains a key without a subkey like

    [man]
        foo = bar

then even a plain

    git help

produces an error message. With this patch such an entry is ignored.

Additionally, the warning about unknown sub-keys is removed. It could
become annoying if new sub-keys are introduced in the future, and then
the configuration is read by an old version of git that does not know
about it.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Apr 24, 2009
1 parent 677fbff commit 178b513
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions builtin-help.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int add_man_viewer_info(const char *var, const char *value)
const char *subkey = strrchr(name, '.');

if (!subkey)
return error("Config with no key for man viewer: %s", name);
return 0;

if (!strcmp(subkey, ".path")) {
if (!value)
Expand All @@ -249,7 +249,6 @@ static int add_man_viewer_info(const char *var, const char *value)
return add_man_viewer_cmd(name, subkey - name, value);
}

warning("'%s': unsupported man viewer sub key.", subkey);
return 0;
}

Expand Down

0 comments on commit 178b513

Please sign in to comment.