git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default
@ 2009-04-23 13:49 Johannes Sixt
  2009-04-23 13:49 ` [PATCH 2/2] builtin-help: silently tolerate unknown keys Johannes Sixt
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Johannes Sixt @ 2009-04-23 13:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Sixt

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 configuration
of remotes.)

Typos in configuration keys usually do not hurt because they never match
in look-ups. But this case is different: it does match, but it does not
have the expected format. With this patch this situation is treated more
like a typo.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 remote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/remote.c b/remote.c
index 91f7485..d66e2f3 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"))
-- 
1.6.3.rc1.88.g1bf9

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-24 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-23 13:49 [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default Johannes Sixt
2009-04-23 13:49 ` [PATCH 2/2] builtin-help: silently tolerate unknown keys Johannes Sixt
2009-04-23 16:40 ` [PATCH 1/2] remote.c: silently tolerate single-level keys like remote.default Jeff King
2009-04-23 18:37   ` Johannes Sixt
2009-04-23 20:01     ` Jeff King
2009-04-24 16:19 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).