diff options
-rw-r--r-- | lib/gall/ll/git2.c | 6 | ||||
-rw-r--r-- | lib/gall/tree.lua | 4 | ||||
-rw-r--r-- | test/test-gall.tree.lua | 2 |
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() |