summaryrefslogtreecommitdiff
path: root/lib/gall/commit.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gall/commit.lua')
-rw-r--r--lib/gall/commit.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/gall/commit.lua b/lib/gall/commit.lua
index 080c7ed..13e3556 100644
--- a/lib/gall/commit.lua
+++ b/lib/gall/commit.lua
@@ -145,6 +145,9 @@ local function _create(repo, data)
}
for i, v in ipairs(data.parents) do
cmd[#cmd+1] = "-p"
+ if not v.sha then
+ return nil, "Parent " .. tostring(i) .. " had no sha?"
+ end
cmd[#cmd+1] = v.sha
end
@@ -152,11 +155,13 @@ local function _create(repo, data)
data.message = data.message .. "\n"
end
- local why, sha = repo:_run_with_input_and_env(env, data.message,
- ll.chomp, unpack(cmd))
+ local why, sha, err = repo:_run_with_input_and_env(env, data.message,
+ ll.chomp, unpack(cmd))
if why ~= 0 then
- return nil, "commit-tree returned " .. tostring(why)
+ return nil, "commit-tree returned " .. tostring(why) ..
+ (sha or "") .. "\n" .. (err or "")
+
end
return repo:get(sha)