Johannes Sixt  committed cd294bc

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

If the config file contains a section like this:

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 <>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits 178b513

Comments (0)

Files changed (1)

 	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"))