@matheusbsbs / matheus-bagliano / commits / 178b513eb7
Fork 0

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>

Johannes Sixt committed Apr 23, 2009 at 15:49 UTC 178b513eb78ac8099588c5bed1f1f74f660cf009
1 file changed +1 -2
builtin-help.c
+1 -2
@@ -236,7 +236,7 @@ static int add_man_viewer_info(const char *var, const char *value)
236 const char *subkey = strrchr(name, '.');
237
238 if (!subkey)
239 - return error("Config with no key for man viewer: %s", name);
239 + return 0;
240
241 if (!strcmp(subkey, ".path")) {
242 if (!value)
@@ -249,7 +249,6 @@ static int add_man_viewer_info(const char *var, const char *value)
249 return add_man_viewer_cmd(name, subkey - name, value);
250 }
251
252 - warning("'%s': unsupported man viewer sub key.", subkey);
252 return 0;
253 }
254