Skip to content

Commit

Permalink
fix: prevent masking env variables (#92)
Browse files Browse the repository at this point in the history
* fix: prevent overwriting env variables

* bump version

* make it 1.1 compat

---------

Co-authored-by: test <[email protected]>
  • Loading branch information
vdayanand and test authored May 5, 2023
1 parent e6c74df commit 0de7540
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RegistryTools"
uuid = "d1eb7eb1-105f-429d-abf5-b0f65cb9e2c4"
authors = ["Stefan Karpinski <[email protected]>"]
version = "2.2.2"
version = "2.2.3"

[deps]
AutoHashEquals = "15f4f7f2-30c1-5605-9d31-71845cf9641f"
Expand Down
4 changes: 3 additions & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function path(cache::RegistryCache, registry_url::AbstractString)
end

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

0 comments on commit 0de7540

Please sign in to comment.