mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
sync_default_gems.rb: search the last merge more strictly [ci skip]
As tag-only match, `[#{repo}]`, may find unexpected commit, e.g.,
5bfca88f76
for io-console, match by
more exact URL pattern.
This commit is contained in:
parent
49c1c2dce3
commit
36bad6f14f
1 changed files with 3 additions and 2 deletions
|
@ -375,8 +375,9 @@ def sync_default_gems_with_commits(gem, ranges, edit: nil)
|
|||
system(*%W"git fetch --no-tags #{gem}")
|
||||
|
||||
if ranges == true
|
||||
log = IO.popen(%W"git log --fixed-strings --grep=[#{repo}] -n1 --format=%B", &:read)
|
||||
ranges = ["#{log[%r[https://github\.com/#{Regexp.quote(repo)}/commit/(\h+)\n\s*(?i:co-authored-by:.*)*\s*\Z], 1]}..#{gem}/master"]
|
||||
pattern = "https://github\.com/#{Regexp.quote(repo)}/commit/([0-9a-f]+)$"
|
||||
log = IO.popen(%W"git log -E --grep=#{pattern} -n1 --format=%B", &:read)
|
||||
ranges = ["#{log[%r[#{pattern}\n\s*(?i:co-authored-by:.*)*\s*\Z], 1]}..#{gem}/master"]
|
||||
end
|
||||
|
||||
commits = ranges.flat_map do |range|
|
||||
|
|
Loading…
Add table
Reference in a new issue