mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Ignore ~/.gitconfig on tool/vcs.rb git commands
Because some `log.*` git configs may change the result of `git log`, `RUBY_LAST_COMMIT_TITLE` can be wrongly formatted and break version.c compilation. So the `git log` executions should not respect user's gitconfig.
This commit is contained in:
parent
84c294eb0b
commit
f3c877e8de
1 changed files with 8 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue