mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
String#[] with index to extract matched substring safely
This commit is contained in:
parent
1dd94dfba3
commit
df3de40932
1 changed files with 1 additions and 1 deletions
|
@ -316,7 +316,7 @@ else
|
||||||
end
|
end
|
||||||
patch = resp.body
|
patch = resp.body
|
||||||
|
|
||||||
message = "\n\n#{(patch.match(/^Subject: (.*)\n\ndiff --git/m)&.[](1) || "Message not found for revision: #{git_rev}\n")}"
|
message = "\n\n#{(patch[/^Subject: (.*)\n\ndiff --git/m, 1] || "Message not found for revision: #{git_rev}\n")}"
|
||||||
puts '+ git apply'
|
puts '+ git apply'
|
||||||
IO.popen(['git', 'apply'], 'w') { |f| f.write(patch) }
|
IO.popen(['git', 'apply'], 'w') { |f| f.write(patch) }
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue