diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-10-09 13:48:22 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-10-09 13:48:22 +0100 |
commit | 56d1e0c06732fd08ccb31addc3a6cddc8d29d1d2 (patch) | |
tree | e38026215736fff21a96bd4c203b344e7b2f8857 | |
parent | cbd4cb507bcbeaa721e23baef7e5da6aa34e8214 (diff) | |
download | gitano-56d1e0c06732fd08ccb31addc3a6cddc8d29d1d2.tar.gz |
Ensure spaces and nulls cannot form part of a repository name
-rw-r--r-- | lib/gitano/repository.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitano/repository.lua b/lib/gitano/repository.lua index f0c05f0..a96dbc2 100644 --- a/lib/gitano/repository.lua +++ b/lib/gitano/repository.lua @@ -601,6 +601,8 @@ local function find_repository(config, reponame) log.ddebug("find_repository", reponame) -- Inject a leading '/' reponame = "/" .. reponame + -- Remove any spaces, tabs, newlines or nulls + reponame = reponame:gsub("[%s%z]+", "") -- Remove any '.' which follows a '/' reponame = reponame:gsub("/%.+", "/") -- simplify any sequence of '/' to a single '/' |