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

remote.c: do not trigger remote.<name>.<var> codepath for two-level names

If the config file contains a section like this: [remote] default = foo (it should be '[remotes]') then commands like git status git checkout git branch -v fail even though they are not obviously related to remotes. (These commands write "ahead, behind" information and, therefore, access the per-remote information). Unknown configuration keys should be ignored, not trigger errors. 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 cd294bc3f3a7b1277551a8c6e0682fdfbe794260
1 file changed +1 -1
remote.c
+1 -1
@@ -366,7 +366,7 @@ static int handle_config(const char *key, const char *value, void *cb)
366 }
367 subkey = strrchr(name, '.');
368 if (!subkey)
369 - return error("Config with no key for remote %s", name);
369 + return 0;
370 remote = make_remote(name, subkey - name);
371 remote->origin = REMOTE_CONFIG;
372 if (!strcmp(subkey, ".mirror"))