From ed869f92851d75115213eb12c4d97bcde2210d59 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 16 Mar 2016 17:48:33 +0000 Subject: Fix build with recent git (2.8.0-rc2) 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 --- lib/gall/tree.lua | 5 +++-- 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() -- cgit v1.2.1