diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-08 17:32:03 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-08 17:32:03 +0100 |
commit | b80edbf10b277115c97a28354a88da97f74d0767 (patch) | |
tree | f017ef6daf467374ebb09fa5b07271a93663f1bc /lib/gall/tree.lua | |
parent | b819441590b259c8390806e7124effb394541041 (diff) | |
download | gall-b80edbf10b277115c97a28354a88da97f74d0767.tar.gz |
GALL.TREE: Test trees as much as possible
Diffstat (limited to 'lib/gall/tree.lua')
-rw-r--r-- | lib/gall/tree.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gall/tree.lua b/lib/gall/tree.lua index ed7ba4b..43f76f1 100644 --- a/lib/gall/tree.lua +++ b/lib/gall/tree.lua @@ -44,10 +44,11 @@ end function tree_method:diff_to(other) -- Generate a diff from self to other local repo = repos[self] - local ok, streediff = repo:rawgather("diff-tree", "-r", "-M", "-C", - objs[self].sha, objs[other].sha) + local ok, streediff, err = repo:rawgather("diff-tree", "-r", "-M", "-C", + ((objs[self] or {}).sha) or "???", + ((objs[other] or {}).sha) or "???") if ok ~= 0 then - return nil, streediff + return nil, (streediff or "") .. "\n" .. (err or "") end local treediff = {} for startmode, endmode, startsha, endsha, action, score, filenames in @@ -176,7 +177,7 @@ local function _create(repo, flat_tree) for k, v in pairs(t) do if k ~= "" then local ok, obj = pcall(function() return v.obj end) - if ok then + if ok and obj then v = obj end if not mode[v.type] then |