@@ -9,28 +9,33 @@ const orig_execpath = deepcopy(get_env("GIT_EXEC_PATH"))
99const orig_cainfo = deepcopy (get_env (" GIT_SSL_CAINFO" ))
1010const orig_templatedir = deepcopy (get_env (" GIT_TEMPLATE_DIR" ))
1111
12- include (" test-utils.jl" )
12+ function withtempdir (f:: Function )
13+ mktempdir () do tmp_dir
14+ cd (tmp_dir) do
15+ f (tmp_dir)
16+ end
17+ end
18+ return nothing
19+ end
1320
1421@testset " GitCommand.jl" begin
15- with_temp_dir () do tmp_dir
22+ withtempdir () do tmp_dir
1623 @test ! isdir (" GitCommand.jl" )
1724 @test ! isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
1825 run (` $(git ()) clone https://github.com/JuliaVersionControl/GitCommand.jl` )
1926 @test isdir (" GitCommand.jl" )
2027 @test isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
2128 end
2229
23- with_temp_dir () do tmp_dir
24- @test ! isdir (" GitCommand.jl" )
25- @test ! isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
30+ withtempdir () do tmp_dir
2631 @test ! isdir (" GitCommand.jl" )
2732 @test ! isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
2833 run (` $(git ()) clone https://github.com/JuliaVersionControl/GitCommand.jl` )
2934 @test isdir (" GitCommand.jl" )
3035 @test isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
3136 end
3237
33- with_temp_dir () do tmp_dir
38+ withtempdir () do tmp_dir
3439 @test ! isdir (" GitCommand.jl" )
3540 @test ! isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
3641 cmd = GitCommand. git ` clone https://github.com/JuliaVersionControl/GitCommand.jl`
@@ -41,6 +46,7 @@ include("test-utils.jl")
4146 @test isdir (" GitCommand.jl" )
4247 @test isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
4348 end
49+
4450end
4551
4652@testset " Safety" begin
0 commit comments