aboutsummaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-10-17 01:52:32 -0700
committerJunio C Hamano <gitster@pobox.com>2008-10-17 01:52:32 -0700
commit46dc1b0e332612aa32c139007fa33f4b429de9d1 (patch)
tree86e934ac60e69c03c44a9d59eab6e400c16efb5f /remote.c
parent84ed4c5d117d72f02cc918e413b9861a9d2846d7 (diff)
parent8ed0a740dd42bd0724aebed6e3b07c4ea2a2d5e8 (diff)
downloadgit-46dc1b0e332612aa32c139007fa33f4b429de9d1.tar.gz
git-46dc1b0e332612aa32c139007fa33f4b429de9d1.tar.xz
Merge branch 'maint'
* maint: t1301-shared-repo.sh: don't let a default ACL interfere with the test git-check-attr(1): add output and example sections xdiff-interface.c: strip newline (and cr) from line before pattern matching t4018-diff-funcname: demonstrate end of line funcname matching flaw t4018-diff-funcname: rework negated last expression test Typo "does not exists" when git remote update remote. remote.c: correct the check for a leading '/' in a remote name Add testcase to ensure merging an early part of a branch is done properly Conflicts: t/t7600-merge.sh
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/remote.c b/remote.c
index d5efadd93..8a04066d6 100644
--- 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);