Skip to content

Commit

Permalink
Merge pull request JuliaLang#23573 from JuliaLang/cv/libgit2-helper-e…
Browse files Browse the repository at this point in the history
…rror

Refactor LibGit2 credential_loop tests
  • Loading branch information
omus committed Sep 7, 2017
2 parents caad8b2 + 10cf8a2 commit 4c8e693
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 170 deletions.
2 changes: 1 addition & 1 deletion test/TestHelpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function with_fake_pty(f)
end
end

function challenge_prompt(code::AbstractString, challenges; timeout::Integer=10, debug::Bool=true)
function challenge_prompt(code::Expr, challenges; timeout::Integer=10, debug::Bool=true)
output_file = tempname()
wrapped_code = """
result = let
Expand Down
9 changes: 8 additions & 1 deletion test/libgit2-helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ function credential_loop(
end
end

return err, num_authentications
# Note: LibGit2.GitError(0) will not work if an error message has been set.
git_error = if err == 0
LibGit2.GitError(LibGit2.Error.None, LibGit2.Error.GIT_OK, "No errors")
else
LibGit2.GitError(err)
end

return git_error, num_authentications
end

function credential_loop(
Expand Down
Loading

0 comments on commit 4c8e693

Please sign in to comment.