summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:45:11 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:45:11 +0000
commit915353fbc1e4bc369a5a72f2768bebce2b6cc13e (patch)
tree5c9d50faa9239cf0bc15f30e2be8299c7082e6ae
parent68baec9d6dc1b5636bda02e6e75a2fabb0ba2da0 (diff)
downloadgitano-915353fbc1e4bc369a5a72f2768bebce2b6cc13e.tar.bz2
Support author and committer
-rw-r--r--lib/gitano/config.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/gitano/config.lua b/lib/gitano/config.lua
index d253f86..26f68d7 100644
--- a/lib/gitano/config.lua
+++ b/lib/gitano/config.lua
@@ -364,7 +364,7 @@ local function serialise_conf(tab)
return table.concat(ret, "\n")
end
-local function commit_config_changes(conf, desc, username)
+local function commit_config_changes(conf, desc, author, committer)
-- Take extant flat tree, clean out users and groups.
-- write out everything we have here, and then prepare
-- and write out a commit.
@@ -406,15 +406,20 @@ local function commit_config_changes(conf, desc, username)
return nil, msg
end
- local person = (username and {
- realname = conf.users[username].real_name,
- email = conf.users[username].email_address
- }) or admin_name
+ author = (author and {
+ realname = conf.users[author].real_name,
+ email = conf.users[author].email_address
+ }) or admin_name
+
+ committer = (committer and {
+ realname = conf.users[committer].real_name,
+ email = conf.users[committer].email_address
+ }) or author
local commit, msg =
gall.commit.create(conf.repo.git, {
- author = person,
- committer = person,
+ author = author,
+ committer = committer,
message = desc or "Updated",
tree = tree,
parents = { conf.commit }