Skip to content

Commit 89b1440

Browse files
committed
tests: don't rely on parent dir being owned by self
1 parent 21ed8fa commit 89b1440

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/git2.test.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ test.it("init bare creates a bare repo", function()
4343
end)
4444

4545
test.it("open existing repo works", function()
46-
local src = debug.getinfo(1, "S").source:sub(2):match("(.*[/\\])")
47-
local repo = git2.open(src .. "..")
46+
local dir = mkTmp("open")
47+
mkCommit(dir, "open")
48+
local repo = git2.open(dir)
4849
test.truthy(repo:path())
4950
test.equal(repo:isBare(), false)
5051
repo:free()

0 commit comments

Comments
 (0)