summaryrefslogtreecommitdiff
path: root/lib/gall/repository.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gall/repository.lua')
-rw-r--r--lib/gall/repository.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/gall/repository.lua b/lib/gall/repository.lua
index 7c4dc81..3a4bb75 100644
--- a/lib/gall/repository.lua
+++ b/lib/gall/repository.lua
@@ -276,6 +276,27 @@ function repomethod:config(confname, value)
end
end
+if ll.git2 then
+ local old_config = repomethod.config
+ function repomethod:config(confname, value)
+ local conf = ll.git2.Config.open(self.path .. "/config" )
+ if not conf then
+ return old_config(self, confname, value)
+ end
+ if not value then
+ local v = conf:get_string(confname)
+ return (v and true or nil), (v and v or "Unknown config: " .. confname)
+ else
+ if type(value) == "number" then
+ conf:set_int64(value)
+ else
+ conf:set_string(confname, tostring(value))
+ end
+ return true
+ end
+ end
+end
+
local repomt = {
__index = repomethod,
__tostring = _repotostring