diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-16 17:48:33 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-16 17:50:12 +0000 |
commit | ed869f92851d75115213eb12c4d97bcde2210d59 (patch) | |
tree | 28d8a0890cfda58e0868c54a6da2a2a764e6eefa | |
parent | f58c7526fbb0421d7f5446644f01f4cf57035ee2 (diff) | |
download | gall-ed869f92851d75115213eb12c4d97bcde2210d59.tar.gz |
Fix build with recent git (2.8.0-rc2)baserock/pedroalvarez/git2.8.0-rc2-fix
This is a workaround in the test-suite for the following bug:
# git diff-tree -r -M -C 5f81a6267072cff1db8a7318ef68690d67032b24 "???"
error: object 5f81a6267072cff1db8a7318ef68690d67032b24 is a tree, not a commit
# echo $?
0
-rw-r--r-- | lib/gall/tree.lua | 5 | ||||
-rw-r--r-- | test/test-gall.tree.lua | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/gall/tree.lua b/lib/gall/tree.lua index 14d75ba..8b78ea9 100644 --- a/lib/gall/tree.lua +++ b/lib/gall/tree.lua @@ -45,8 +45,9 @@ function tree_method:diff_to(other) -- Generate a diff from self to other local repo = repos[self] local ok, streediff, err = repo:rawgather("diff-tree", "-r", "-M", "-C", - ((objs[self] or {}).sha) or "???", - ((objs[other] or {}).sha) or "???") + ((objs[self] or {}).sha) or "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", + ((objs[other] or {}).sha) or "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391") + if ok ~= 0 then return nil, (streediff or "") .. "\n" .. (err or "") end diff --git a/test/test-gall.tree.lua b/test/test-gall.tree.lua index e1d5449..1720aab 100644 --- a/test/test-gall.tree.lua +++ b/test/test-gall.tree.lua @@ -66,7 +66,7 @@ function suite.bad_diff() local tree = commit.tree.content local ok, msg = tree:diff_to() assert(not ok) - assert(msg:find("%?%?%?")) + assert(msg:find("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391")) end function suite.diff_trees() |