summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:53:47 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:53:47 +0000
commite3df3ec1733c4021c4491c7a0d00c8ea4bf71c56 (patch)
treeb36f232fefa6ea7e2e998661bdf28095de9b3ddd
parentbe237c63d176019757d6bb0ba461173c2fa2e590 (diff)
downloadgitano-e3df3ec1733c4021c4491c7a0d00c8ea4bf71c56.tar.bz2
Thread the old user context through cleanly
-rw-r--r--lib/gitano/admincommand.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitano/admincommand.lua b/lib/gitano/admincommand.lua
index 88064f3..eaa98fd 100644
--- a/lib/gitano/admincommand.lua
+++ b/lib/gitano/admincommand.lua
@@ -65,6 +65,7 @@ local function builtin_as_prep(conf, _, cmdline, context)
-- The context contains the user we are right now.
-- We need to acquire information about that, so ask the config
local as = { user = context.user }
+ cmdline.saved_user = context.user
config.populate_context(conf, as)
for k, v in pairs(as) do
context["as_" .. k] = v
@@ -83,7 +84,7 @@ end
local function builtin_as_run(conf, _, cmdline, env)
-- Override some of the environment
- env.GITANO_ORIG_USER = env.GITANO_USER
+ env.GITANO_ORIG_USER = cmdline.saved_user
env.GITANO_USER = cmdline[2]
env.GITANO_KEYTAG = "<*>"
env.GITANO_PROJECT = (cmdline.repo or {}).name