]> asedeno.scripts.mit.edu Git - git.git/blobdiff - remote.c
Merge branch 'tr/workflow-doc'
[git.git] / remote.c
index d5efadd93d63b2c39176763eb325ecddb6c1215a..8a04066d6142823183033aaff8754febe31ad1b0 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -341,13 +341,14 @@ static int handle_config(const char *key, const char *value, void *cb)
        if (prefixcmp(key,  "remote."))
                return 0;
        name = key + 7;
+       if (*name == '/') {
+               warning("Config remote shorthand cannot begin with '/': %s",
+                       name);
+               return 0;
+       }
        subkey = strrchr(name, '.');
        if (!subkey)
                return error("Config with no key for remote %s", name);
-       if (*subkey == '/') {
-               warning("Config remote shorthand cannot begin with '/': %s", name);
-               return 0;
-       }
        remote = make_remote(name, subkey - name);
        if (!strcmp(subkey, ".mirror"))
                remote->mirror = git_config_bool(key, value);