summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gall/ll.lua13
-rw-r--r--test/test-gall.ll.lua13
2 files changed, 20 insertions, 6 deletions
diff --git a/lib/gall/ll.lua b/lib/gall/ll.lua
index 24f76bb..92200a4 100644
--- a/lib/gall/ll.lua
+++ b/lib/gall/ll.lua
@@ -90,12 +90,13 @@ local simple_cmds = {
for _, s in pairs(simple_cmds) do
local ss = s:gsub("%-", "_")
- mod_ret[ss] = function(_t)
- local t = util.deep_copy(_t)
- table.insert(t, 1, s)
- t.stdout = _chomp
- return _rungit(t)
- end
+ local function ss_fn(_t)
+ local t = util.deep_copy(_t)
+ table.insert(t, 1, s)
+ t.stdout = _chomp
+ return _rungit(t)
+ end
+ mod_ret[ss] = ss_fn
end
return mod_ret
diff --git a/test/test-gall.ll.lua b/test/test-gall.ll.lua
index 90e3f8b..8dfb0be 100644
--- a/test/test-gall.ll.lua
+++ b/test/test-gall.ll.lua
@@ -60,6 +60,19 @@ function suite.test_rungit()
assert(stderr == nil or stderr == "")
end
+function suite.test_rungit_stderr()
+ local args = {
+ repo = "/DOES_NOT_EXIST",
+ stderr = gall.ll.chomp,
+ stdout = gall.ll.chomp,
+ "log"
+ }
+ local why, stdout, stderr = gall.ll.rungit(args)
+ assert(why ~= 0)
+ assert(stdout == nil or stdout == "")
+ assert(stderr:find("DOES_NOT_EXIST"))
+end
+
function suite.test_hash_object()
local args = {
repo = ".",