diff --git a/base/libgit2/types.jl b/base/libgit2/types.jl index 19fdc67f7d720..89cb7e16a34ef 100644 --- a/base/libgit2/types.jl +++ b/base/libgit2/types.jl @@ -699,7 +699,7 @@ mutable struct SSHCredentials <: AbstractCredentials finalizer(c, securezero!) return c end - SSHCredentials(u::AbstractString,p::AbstractString,prompt_if_incorrect::Bool=false) = SSHCredentials(u,p,prompt_if_incorrect) + SSHCredentials(u::AbstractString,p::AbstractString,prompt_if_incorrect::Bool=false) = SSHCredentials(u,p,"","",prompt_if_incorrect) SSHCredentials(prompt_if_incorrect::Bool=false) = SSHCredentials("","","","",prompt_if_incorrect) end diff --git a/test/libgit2.jl b/test/libgit2.jl index 26e899c72bea8..bd6c4a8144f41 100644 --- a/test/libgit2.jl +++ b/test/libgit2.jl @@ -1249,6 +1249,11 @@ mktempdir() do dir @test LibGit2.checkused!(creds) @test creds.user == creds_user @test creds.pass == creds_pass + sshcreds = LibGit2.SSHCredentials(creds_user, creds_pass) + @test sshcreds.user == creds_user + @test sshcreds.pass == creds_pass + @test isempty(sshcreds.prvkey) + @test isempty(sshcreds.pubkey) end # The following tests require that we can fake a TTY so that we can provide passwords