summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2009-04-23 15:49:05 +0200
committerJunio C Hamano <gitster@pobox.com>2009-04-24 01:29:28 -0700
commitcd294bc3f3a7b1277551a8c6e0682fdfbe794260 (patch)
treec1c00a925c499147d919d70075abab042579ec66 /remote.c
parent178b513eb78ac8099588c5bed1f1f74f660cf009 (diff)
downloadgit-cd294bc3f3a7b1277551a8c6e0682fdfbe794260.tar.gz
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>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index 91f748550e..d66e2f3c93 100644
--- a/remote.c
+++ b/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"))