Merge branch 'sg/core-filemode-doc-typofix' into maint
[gitweb.git] / remote.c
index 72b4591b98363a83693db82d670a16f05c1e2192..32f137e96643b04ed70693b6d4367ea7618904c4 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -649,7 +649,12 @@ static int valid_remote_nick(const char *name)
 {
        if (!name[0] || is_dot_or_dotdot(name))
                return 0;
-       return !strchr(name, '/'); /* no slash */
+
+       /* remote nicknames cannot contain slashes */
+       while (*name)
+               if (is_dir_sep(*name++))
+                       return 0;
+       return 1;
 }
 
 const char *remote_for_branch(struct branch *branch, int *explicit)