Skip to content

Commit d57c329

Browse files
committed
Re-fix VCS::GIT#branch_beginning
Count the last release date from the whole working directory, not only the version headers.
1 parent 61c372a commit d57c329

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tool/lib/vcs.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,19 +448,18 @@ def export(revision, url, dir, keep_temp = false)
448448
end
449449

450450
def branch_beginning(url)
451-
files = %w[version.h include/ruby/version.h]
452-
year = cmd_read(%W[ #{COMMAND} log -n1 --format=%cd --date=format:%Y #{url} --] + files).to_i
451+
year = cmd_read(%W[ #{COMMAND} log -n1 --format=%cd --date=format:%Y #{url} --]).to_i
453452
cmd_read(%W[ #{COMMAND} log --format=format:%H --reverse --since=#{year-1}-12-25
454453
--author=matz --committer=matz --grep=started\\.$
455-
#{url} --] + files)[/.*/]
454+
#{url} -- version.h include/ruby/version.h])[/.*/]
456455
end
457456

458457
def export_changelog(url = '@', from = nil, to = nil, _path = nil, path: _path, base_url: true)
459458
from, to = [from, to].map do |rev|
460459
rev or next
461460
rev unless rev.empty?
462461
end
463-
unless (from && /./.match(from)) or ((from = branch_beginning(url)) && /./.match(from))
462+
unless from&.match?(/./) or (from = branch_beginning(url))&.match?(/./)
464463
warn "no starting commit found", uplevel: 1
465464
from = nil
466465
end

0 commit comments

Comments
 (0)