diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-06-05 20:07:19 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-06-05 20:23:23 +0900 |
commit | f3c877e8deaea91ff27c0fca837c9388d030a896 (patch) | |
tree | f111f45c542a1361d85efdee7791b7aae3622eea /tool | |
parent | 84c294eb0b5b5206f01f062d4c2c860a57c7873c (diff) | |
download | ruby-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')
-rw-r--r-- | tool/vcs.rb | 9 |
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) |