From e30c7013862a9d2c2ae60e403a1624e54475c4c7 Mon Sep 17 00:00:00 2001
From: Unknwon <u@gogs.io>
Date: Fri, 8 Jul 2016 07:34:05 +0800
Subject: [PATCH] #3229 disallow repository name . and ..

Since . and .. has browser automatical behaviors, we need to disallow those names.
---
 models/repo.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/models/repo.go b/models/repo.go
index 786fc167bc..870e63b207 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -518,7 +518,7 @@ func (repo *Repository) CloneLink() (cl *CloneLink) {
 }
 
 var (
-	reservedNames    = []string{"debug", "raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin", "new"}
+	reservedNames    = []string{"debug", "raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin", "new", ".", ".."}
 	reservedPatterns = []string{"*.git", "*.keys", "*.wiki"}
 )