1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vcs.rb: do not reference the constant before assignment

This commit is contained in:
Nobuyoshi Nakada 2022-11-01 11:23:31 +09:00
parent 2d3ecc4d28
commit aa8c6759ee
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -424,12 +424,12 @@ class VCS
SAFE_DIRECTORIES ||=
begin
command = ENV["GIT"] || 'git'
IO.popen(%W"#{command} config --global --get-all safe.directory", &:read).split("\n")
dirs = IO.popen(%W"#{command} config --global --get-all safe.directory", &:read).split("\n")
rescue
command = nil
[]
dirs = []
ensure
VCS.dump(SAFE_DIRECTORIES, "safe.directory: ") if $DEBUG
VCS.dump(dirs, "safe.directory: ") if $DEBUG
COMMAND = command
end