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 ||= SAFE_DIRECTORIES ||=
begin begin
command = ENV["GIT"] || 'git' 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 rescue
command = nil command = nil
[] dirs = []
ensure ensure
VCS.dump(SAFE_DIRECTORIES, "safe.directory: ") if $DEBUG VCS.dump(dirs, "safe.directory: ") if $DEBUG
COMMAND = command COMMAND = command
end end