summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-06 15:38:19 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-06 15:38:19 +0000
commit2c234c45fa65b18e2f5d09fcaf1d1f2ea3ad83b9 (patch)
tree76a097ac0b8ec6f19f18541c63f7bacc5ac43b5f
parent7218b7bc4beb6b6dfc325acf4ae7152223132c42 (diff)
downloadgall-2c234c45fa65b18e2f5d09fcaf1d1f2ea3ad83b9.tar.gz
Support unstable's libgit2 and git changes
-rw-r--r--lib/gall/ll/git2.c6
-rw-r--r--lib/gall/tree.lua4
-rw-r--r--test/test-gall.tree.lua2
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/gall/ll/git2.c b/lib/gall/ll/git2.c
index 8fee1dc..7aca7fa 100644
--- a/lib/gall/ll/git2.c
+++ b/lib/gall/ll/git2.c
@@ -220,7 +220,11 @@ static int L_set_symbolic_ref(lua_State *L)
if ((ret = git_reference_symbolic_create(&ref, repo,
luaL_checkstring(L, 2),
luaL_checkstring(L, 3),
- 1, NULL, NULL)) != 0) {
+ 1, NULL
+#if LIBGIT2_VER_MINOR < 23
+ , NULL
+#endif
+ )) != 0) {
return push_git2_error(L, ret);
}
git_reference_free(ref);
diff --git a/lib/gall/tree.lua b/lib/gall/tree.lua
index 6c57ee0..df8d1e4 100644
--- a/lib/gall/tree.lua
+++ b/lib/gall/tree.lua
@@ -83,8 +83,8 @@ 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 "DOES_NOT_EXIST",
+ ((objs[other] or {}).sha) or "DOES_NOT_EXIST")
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 9d789aa..48bf128 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("DOES_NOT_EXIST"))
end
function suite.diff_trees()