@@ -22,13 +22,32 @@ mktempdir() do dir
22
22
try
23
23
repo_path = joinpath (dir, " Example2" )
24
24
# credentials are required because github tries to authenticate on unknown repo
25
- cred = LibGit2. UserPasswordCredentials (" " , " " ) # empty credentials cause authentication error
25
+ cred = LibGit2. UserPasswordCredentials (" JeffBezanson " , " hunter2 " ) # make sure Jeff is using a good password :)
26
26
LibGit2. clone (repo_url* randstring (10 ), repo_path, payload= Nullable (cred))
27
27
error (" unexpected" )
28
28
catch ex
29
29
@test isa (ex, LibGit2. Error. GitError)
30
30
@test ex. code == LibGit2. Error. EAUTH
31
31
end
32
32
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
33
52
end
34
53
end
0 commit comments