Skip to content

Commit

Permalink
remote.c: do not trigger remote.<name>.<var> codepath for two-level n…
Browse files Browse the repository at this point in the history
…ames

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>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Apr 24, 2009
1 parent 178b513 commit cd294bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion remote.c
Original file line number Diff line number Diff line change
@@ -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"))

0 comments on commit cd294bc

Please sign in to comment.