@@ -9,28 +9,33 @@ const orig_execpath = deepcopy(get_env("GIT_EXEC_PATH"))
9
9
const orig_cainfo = deepcopy (get_env (" GIT_SSL_CAINFO" ))
10
10
const orig_templatedir = deepcopy (get_env (" GIT_TEMPLATE_DIR" ))
11
11
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
13
20
14
21
@testset " GitCommand.jl" begin
15
- with_temp_dir () do tmp_dir
22
+ withtempdir () do tmp_dir
16
23
@test ! isdir (" GitCommand.jl" )
17
24
@test ! isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
18
25
run (` $(git ()) clone https://github.com/JuliaVersionControl/GitCommand.jl` )
19
26
@test isdir (" GitCommand.jl" )
20
27
@test isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
21
28
end
22
29
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
26
31
@test ! isdir (" GitCommand.jl" )
27
32
@test ! isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
28
33
run (` $(git ()) clone https://github.com/JuliaVersionControl/GitCommand.jl` )
29
34
@test isdir (" GitCommand.jl" )
30
35
@test isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
31
36
end
32
37
33
- with_temp_dir () do tmp_dir
38
+ withtempdir () do tmp_dir
34
39
@test ! isdir (" GitCommand.jl" )
35
40
@test ! isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
36
41
cmd = GitCommand. git ` clone https://github.com/JuliaVersionControl/GitCommand.jl`
@@ -41,6 +46,7 @@ include("test-utils.jl")
41
46
@test isdir (" GitCommand.jl" )
42
47
@test isfile (joinpath (" GitCommand.jl" , " Project.toml" ))
43
48
end
49
+
44
50
end
45
51
46
52
@testset " Safety" begin
0 commit comments