summaryrefslogtreecommitdiff
path: root/lib/gitano/repository.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitano/repository.lua')
-rw-r--r--lib/gitano/repository.lua27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/gitano/repository.lua b/lib/gitano/repository.lua
index 796e162..a15fcbe 100644
--- a/lib/gitano/repository.lua
+++ b/lib/gitano/repository.lua
@@ -183,8 +183,13 @@ function repo_method:check_local_git_files()
end
if anonexport then
log.ddebug("<" .. self.name .. ">: Anonymous read allowed")
- local fh = sio.open(self:fs_path() .. "/git-daemon-export-ok", "wc")
- fh:close()
+ local fh, errmsg = sio.open(self:fs_path() .. "/git-daemon-export-ok", "wc")
+
+ if fh then
+ fh:close()
+ else
+ log.warn("Can't create git-daemon-export file:", errmsg)
+ end
else
log.ddebug("<" .. self.name .. ">: Anonymous read not allowed")
luxio.unlink(self:fs_path() .. "/git-daemon-export-ok")
@@ -381,6 +386,24 @@ function repo_method:populate_context(context)
context["owner"] = self:conf_get "project.owner"
end
context["_repo"] = self
+ if not self.is_nascent then
+ local lists_to_add = {}
+ for k, v in self.project_config:each() do
+ if k:match("%.i_[0-9]+$") then
+ lists_to_add[k:gsub("%.i_[0-9]+$", "")] = true
+ else
+ local confkey = "config/" .. k:gsub("%.", "/")
+ context[confkey] = v
+ end
+ end
+ for k in pairs(lists_to_add) do
+ local confkey = "config/" .. k:gsub("%.", "/")
+ local vallist = self.project_config:get_list(k)
+ local valset = {}
+ for _, v in pairs(vallist) do valset[v] = true end
+ context[confkey] = valset
+ end
+ end
end
function repo_method:realise()