diff --git a/tool/vcs.rb b/tool/vcs.rb index 618a788dc7..86e7e50f0c 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -399,7 +399,7 @@ class VCS end def self.cmd_read_at(srcdir, cmds) - IO.pread(*cmd_args(cmds, srcdir)) + without_gitconfig { IO.pread(*cmd_args(cmds, srcdir)) } end def self.get_revisions(path, srcdir = nil) @@ -444,6 +444,13 @@ class VCS rev[0, 10] end + def self.without_gitconfig + home = ENV.delete('HOME') + yield + ensure + ENV['HOME'] = home if home + end + def initialize(*) super if srcdir = @srcdir and self.class.local_path?(srcdir)