From 22ded183cd7a29816d24dcc2aaf4d4da57ddac9d Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 23 Apr 2018 12:12:23 +0200 Subject: [PATCH] Pkg3: deterministically close the LibGit2 repo in tests (#26883) --- stdlib/Pkg3/test/pkg.jl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/stdlib/Pkg3/test/pkg.jl b/stdlib/Pkg3/test/pkg.jl index 4c43ccafb5807..4603572ceb513 100644 --- a/stdlib/Pkg3/test/pkg.jl +++ b/stdlib/Pkg3/test/pkg.jl @@ -146,13 +146,14 @@ temp_pkg_dir() do project_path @testset "legacy CI script" begin mktempdir() do dir - LibGit2.clone("https://github.com/JuliaLang/Example.jl", joinpath(dir, "Example.jl")) - cd(joinpath(dir, "Example.jl")) do - let Pkg = Pkg3 - Pkg.clone(pwd()) - Pkg.build("Example") - Pkg.test("Example"; coverage=true) - @test isfile(Pkg.dir("Example", "src", "Example.jl")) + LibGit2.with(LibGit2.clone("https://github.com/JuliaLang/Example.jl", joinpath(dir, "Example.jl"))) do r + cd(joinpath(dir, "Example.jl")) do + let Pkg = Pkg3 + Pkg.clone(pwd()) + Pkg.build("Example") + Pkg.test("Example"; coverage=true) + @test isfile(Pkg.dir("Example", "src", "Example.jl")) + end end end end