summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--remote.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index ad6c5424ed..1949882c10 100644
--- a/remote.c
+++ b/remote.c
@@ -645,7 +645,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)