diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2016-12-03 13:31:37 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2016-12-03 13:31:37 +0000 |
commit | 27f0c0959328e0ecd2468940739c9fd1773db3f1 (patch) | |
tree | abc772c1ac244076c1370ff74fda10eb37c0f67b /lib | |
parent | 63ba72371f74cb66244decf167bf8a2caee1a6ea (diff) | |
download | gitano-27f0c0959328e0ecd2468940739c9fd1773db3f1.tar.gz |
Support gathering output from gc/fsck/count-objects
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitano/repocommand.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/gitano/repocommand.lua b/lib/gitano/repocommand.lua index cc81146..af4584a 100644 --- a/lib/gitano/repocommand.lua +++ b/lib/gitano/repocommand.lua @@ -8,6 +8,8 @@ local log = require 'gitano.log' local util = require 'gitano.util' local repository = require 'gitano.repository' +local unpack = table.unpack or unpack + local builtin_gc_short = "Invoke git gc on your repository" local builtin_gc_helptext = [[ usage: gc repo [options] @@ -60,10 +62,16 @@ local function builtin_simple_validate(config, repo, cmdline) end local function builtin_simple_run(config, repo, cmdline, env) - local cmdcopy = {cmdline[1], env=util.deep_copy(env)} - cmdcopy.env.GIT_DIR=repo:fs_path() + local cmdcopy = {cmdline[1]} for i = 3, #cmdline do cmdcopy[#cmdcopy+1] = cmdline[i] end - return repo:git_command(cmdcopy) + local why, stdout, stderr = repo.git:rawgather(unpack(cmdcopy)) + if stdout ~= "" then + log.stdout(stdout) + end + if stderr ~= "" then + log.state(stderr) + end + return "exit", why end local function register_repocommand(register_cmd) |