summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-09-17 22:24:09 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2022-09-17 22:24:10 +0900
commit33c6dd2cc89c27bbf406508ec39038a181fb99bc (patch)
tree6e0a3d9a25f6600a5ba832df315bb1d8e1d27d59 /tool/lib
parent1825d3673f2a5504b65ba31a9fb6c2e52edf1fc3 (diff)
downloadruby-33c6dd2cc89c27bbf406508ec39038a181fb99bc.tar.gz
Fallback to VCS.release_date on VCS::NotFoundError
when -q is given. One of the RubyCI servers, freebsd12, had a broken git environment: ``` $ git show fatal: detected dubious ownership in repository at '/usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby' To add an exception for this directory, call: git config --global --add safe.directory /usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby ``` tool/lib/vcs.rb doesn't work normally for that server. Even for such cases, we'd like to generate a usable revision.h. So this patch lets revision.h fallback to default VCS.release_date when VCS::NotFoundError is raised.
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/vcs.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb
index d33d41dba1..29f2327bc3 100644
--- a/tool/lib/vcs.rb
+++ b/tool/lib/vcs.rb
@@ -95,7 +95,7 @@ class VCS
opts
end
- def self.release_date(time)
+ def self.release_date(time = Time.now - 10) # the same default as make-snapshot
t = time.utc
[
t.strftime('#define RUBY_RELEASE_YEAR %Y'),