aboutsummaryrefslogtreecommitdiffstats
path: root/tool/vcs.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-06-05 20:07:19 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-06-05 20:23:23 +0900
commitf3c877e8deaea91ff27c0fca837c9388d030a896 (patch)
treef111f45c542a1361d85efdee7791b7aae3622eea /tool/vcs.rb
parent84c294eb0b5b5206f01f062d4c2c860a57c7873c (diff)
downloadruby-f3c877e8deaea91ff27c0fca837c9388d030a896.tar.gz
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.
Diffstat (limited to 'tool/vcs.rb')
-rw-r--r--tool/vcs.rb9
1 files changed, 8 insertions, 1 deletions
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)