summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:45:31 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:45:31 +0000
commitbe237c63d176019757d6bb0ba461173c2fa2e590 (patch)
tree2e7648fb6b73ff6dc5617302f0ae4738e10e6d0b
parent915353fbc1e4bc369a5a72f2768bebce2b6cc13e (diff)
downloadgitano-be237c63d176019757d6bb0ba461173c2fa2e590.tar.bz2
Support passing the committer for user and group and sshkey commands
-rw-r--r--lib/gitano/admincommand.lua5
-rw-r--r--lib/gitano/usercommand.lua2
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitano/admincommand.lua b/lib/gitano/admincommand.lua
index 334c4d3..88064f3 100644
--- a/lib/gitano/admincommand.lua
+++ b/lib/gitano/admincommand.lua
@@ -83,6 +83,7 @@ end
local function builtin_as_run(conf, _, cmdline, env)
-- Override some of the environment
+ env.GITANO_ORIG_USER = env.GITANO_USER
env.GITANO_USER = cmdline[2]
env.GITANO_KEYTAG = "<*>"
env.GITANO_PROJECT = (cmdline.repo or {}).name
@@ -295,7 +296,7 @@ local function builtin_user_run(conf, _, cmdline, env)
end
if reason then
-- Need to try and make a config commit
- local ok, commit = config.commit(conf, reason, env.GITANO_USER)
+ local ok, commit = config.commit(conf, reason, env.GITANO_USER, env.GITANO_ORIG_USER)
if not ok then
log.fatal(commit)
end
@@ -609,7 +610,7 @@ local function builtin_group_run(conf, _, cmdline, env)
log.fatal("Unknown sub command", cmdline[2])
end
if reason then
- local ok, commit = config.commit(conf, reason, env.GITANO_USER)
+ local ok, commit = config.commit(conf, reason, env.GITANO_USER, env.GITANO_ORIG_USER)
if not ok then
log.fatal(commit)
end
diff --git a/lib/gitano/usercommand.lua b/lib/gitano/usercommand.lua
index 2e4f1b7..3816f36 100644
--- a/lib/gitano/usercommand.lua
+++ b/lib/gitano/usercommand.lua
@@ -213,7 +213,7 @@ local function builtin_sshkey_run(conf, _, cmdline, env)
local action = (cmdline[2] == "add") and "Added" or "Deleted"
action = action .. " " .. cmdline[3] .. " for " .. env.GITANO_USER
- local ok, msg = config.commit(conf, action, env.GITANO_USER)
+ local ok, msg = config.commit(conf, action, env.GITANO_USER, env.GITANO_ORIG_USER)
if not ok then
log.error(msg)