Skip to content

Commit cd294bc

Browse files
j6tgitster
authored andcommitted
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>
1 parent 178b513 commit cd294bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static int handle_config(const char *key, const char *value, void *cb)
366366
}
367367
subkey = strrchr(name, '.');
368368
if (!subkey)
369-
return error("Config with no key for remote %s", name);
369+
return 0;
370370
remote = make_remote(name, subkey - name);
371371
remote->origin = REMOTE_CONFIG;
372372
if (!strcmp(subkey, ".mirror"))

0 commit comments

Comments
 (0)