Skip to content

Commit

Permalink
Fix locale of Git command (#90)
Browse files Browse the repository at this point in the history
In environments where language is set to something different to English, Git output is printed in the respective language.

This commit forces the output to be in American English for proper parsing.
  • Loading branch information
mofeing committed Apr 19, 2023
1 parent f7e24a4 commit ac9e9cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function path(cache::RegistryCache, registry_url::AbstractString)
end

function get_registry_default_branch(git::Cmd)
lines = collect(eachline(`$git remote show origin`))
lines = collect(eachline(Cmd(`$git remote show origin`, env=("LANG" => "en_US.UTF-8",))))
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 ac9e9cf

Please sign in to comment.