Merge branch 'ab/sha1dc-maint'
[gitweb.git] / remote.c
index fdc52d802cec6b5322689f1fda79c9cabe9dbb01..e43b1460f89cb673227a28ec9357f99237146563 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)