summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e6d4bc)
raw | patch | inline | side by side (parent: 4e6d4bc)
author | Brandon Casey <casey@nrlssc.navy.mil> | |
Tue, 14 Oct 2008 20:30:21 +0000 (15:30 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 15 Oct 2008 00:18:29 +0000 (17:18 -0700) |
This test is supposed to disallow remote entries in the config file of the
form:
[remote "/foobar"]
...
The leading slash in '/foobar' is not acceptable.
Instead it was incorrectly testing that the subkey had no leading '/', which
had no effect since the subkey pointer was made to point at a '.' in the
preceding lines.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
form:
[remote "/foobar"]
...
The leading slash in '/foobar' is not acceptable.
Instead it was incorrectly testing that the subkey had no leading '/', which
had no effect since the subkey pointer was made to point at a '.' in the
preceding lines.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c | patch | blob | history |
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);