Skip to content

Commit 8c19548

Browse files
committed
Add back the empty-credentials test but as test_broken
on windows with libgit2 >= v0.26
1 parent e482c6c commit 8c19548

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/libgit2-online.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,24 @@ mktempdir() do dir
3030
@test ex.code == LibGit2.Error.EAUTH
3131
end
3232
end
33+
34+
@testset "with empty credentials" begin
35+
try
36+
repo_path = joinpath(dir, "Example3")
37+
# credentials are required because github tries to authenticate on unknown repo
38+
cred = LibGit2.UserPasswordCredentials("","") # empty credentials cause authentication error
39+
LibGit2.clone(repo_url*randstring(10), repo_path, payload=Nullable(cred))
40+
error("unexpected")
41+
catch ex
42+
@test isa(ex, LibGit2.Error.GitError)
43+
if is_windows() && LibGit2.version() >= v"0.26.0"
44+
# see #22681 and https://github.com/libgit2/libgit2/pull/4055
45+
@test_broken ex.code == LibGit2.Error.EAUTH
46+
@test ex.code == LibGit2.Error.ERROR
47+
else
48+
@test ex.code == LibGit2.Error.EAUTH
49+
end
50+
end
51+
end
3352
end
3453
end

0 commit comments

Comments
 (0)