diff --git a/remote.c b/remote.c
index 105668f8a3cf13c2a759e9da4d0acc50ef781de9..7688f3b04d197007bce64a2bcc54c0b62c0b5922 100644 (file)
--- a/remote.c
+++ b/remote.c
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);