diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-04-30 22:13:47 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-04-30 22:13:47 +0900 |
commit | df3de409325d1e95d375a736d2bc9c45d47ec317 (patch) | |
tree | c918ac1ca6d5b47017028bcbfa1d80de8ff34f48 /tool | |
parent | 1dd94dfba3ed3ffd087d1ba93154cb922033a37c (diff) | |
download | ruby-df3de409325d1e95d375a736d2bc9c45d47ec317.tar.gz |
String#[] with index to extract matched substring safely
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/merger.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/merger.rb b/tool/merger.rb index 755e55c967..025a559408 100755 --- a/tool/merger.rb +++ b/tool/merger.rb @@ -316,7 +316,7 @@ else end 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' IO.popen(['git', 'apply'], 'w') { |f| f.write(patch) } else |