diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2016-01-13 15:24:57 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2016-01-13 15:24:57 +0000 |
commit | b7c1869c1e778a002dca9ac60f11295b3d9cf681 (patch) | |
tree | df9700629d11e10f31767560b62ea2db3b539fcf /bin | |
parent | 2fa6071ef9375bb9c823dce3018c029e136a38e5 (diff) | |
download | gitano-b7c1869c1e778a002dca9ac60f11295b3d9cf681.tar.gz |
Call git commands through repo:git_command()
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/gitano-smart-http.cgi.in | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/gitano-smart-http.cgi.in b/bin/gitano-smart-http.cgi.in index 6f8fdee..31749ec 100755 --- a/bin/gitano-smart-http.cgi.in +++ b/bin/gitano-smart-http.cgi.in @@ -13,7 +13,6 @@ local gitano = require "gitano" local gall = require "gall" local luxio = require "luxio" -local subprocess = require "luxio.subprocess" local sio = require "luxio.simple" -- @@GITANO_BIN_PATH @@ -63,14 +62,17 @@ if request_method == "GET" or request_method == "POST" then gitano.log.cap_level(gitano.log.level.INFO) local transactionid = gitano.log.syslog.open() - if cmdline and gitano.auth.is_authorized(user, "http", cmdline, - os.getenv("GITANO_ROOT"), - transactionid, - start_log_level) then - local proc = subprocess.spawn_simple({"git", "http-backend"}) + local authorized, cmd, parsed_cmdline, config, env, repo + if cmdline then + authorized, cmd, parsed_cmdline, config, env, repo = + gitano.auth.is_authorized(user, "http", cmdline, + os.getenv("GITANO_ROOT"), + transactionid, + start_log_level) + if cmdline and authorized then local exit_code - _, exit_code = proc:wait() + _, exit_code = repo:git_command{"http-backend"} if exit_code ~= 0 then stdout:write("Status: 500 Internal Server Error\r\n\r\n") |