From 6687aa435ad3a6e8f1345e36bcfaf4247cae6c57 Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Fri, 24 May 2024 18:35:11 +0200 Subject: [PATCH] Add a hack to fix tests on Windows --- test/runtests.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 01d00d5b..32f94cb4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -30,7 +30,12 @@ template_options = Dict( tmpdir1 = mktempdir() tmpdir2 = mktempdir() - COPIERTemplate.generate(tmpdir1; data = template_options, vcs_ref = "main") + # This is a hack because Windows managed to dirty the repo. + if get(ENV, "CI", "nothing") == "true" && Sys.iswindows() + run(`git reset --hard HEAD`) + end + + COPIERTemplate.generate(tmpdir1; data = template_options, vcs_ref = "HEAD") bash_args = vcat([["-d"; "$k=$v"] for (k, v) in template_options]...) ignore(line) = startswith("_commit")(line) || startswith("_src_path")(line) template_path = joinpath(@__DIR__, "..")