mirror of
https://github.com/git/git.git
synced 2024-11-23 18:05:29 +08:00
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>
This commit is contained in:
parent
178b513eb7
commit
cd294bc3f3
2
remote.c
2
remote.c
@ -366,7 +366,7 @@ static int handle_config(const char *key, const char *value, void *cb)
|
||||
}
|
||||
subkey = strrchr(name, '.');
|
||||
if (!subkey)
|
||||
return error("Config with no key for remote %s", name);
|
||||
return 0;
|
||||
remote = make_remote(name, subkey - name);
|
||||
remote->origin = REMOTE_CONFIG;
|
||||
if (!strcmp(subkey, ".mirror"))
|
||||
|
Loading…
Reference in New Issue
Block a user