Skip to content

Commit 178b513

Browse files
j6tgitster
authored andcommitted
builtin-help: silently tolerate unknown keys
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>
1 parent 677fbff commit 178b513

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

builtin-help.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static int add_man_viewer_info(const char *var, const char *value)
236236
const char *subkey = strrchr(name, '.');
237237

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

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

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

0 commit comments

Comments
 (0)