Skip to content

Commit 0de7540

Browse files
vdayanandtest
and
test
authored
fix: prevent masking env variables (#92)
* fix: prevent overwriting env variables * bump version * make it 1.1 compat --------- Co-authored-by: test <test@example.com>
1 parent e6c74df commit 0de7540

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RegistryTools"
22
uuid = "d1eb7eb1-105f-429d-abf5-b0f65cb9e2c4"
33
authors = ["Stefan Karpinski <stefan@karpinski.org>"]
4-
version = "2.2.2"
4+
version = "2.2.3"
55

66
[deps]
77
AutoHashEquals = "15f4f7f2-30c1-5605-9d31-71845cf9641f"

src/types.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ function path(cache::RegistryCache, registry_url::AbstractString)
2222
end
2323

2424
function get_registry_default_branch(git::Cmd)
25-
lines = collect(eachline(Cmd(`$git remote show origin`, env=("LANG" => "en_US.UTF-8",))))
25+
env = copy(ENV)
26+
env["LANG"] = "en_US.UTF-8"
27+
lines = collect(eachline(setenv(`$git remote show origin`, env)))
2628
idx = findfirst(x -> occursin("HEAD branch", x), lines)
2729
idx === nothing && error("Failed to get default branch of registry")
2830
strip(split(lines[idx], ":")[2])

0 commit comments

Comments
 (0)