String#[] with index to extract matched substring safely
This commit is contained in:
parent
1dd94dfba3
commit
df3de40932
@ -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…
x
Reference in New Issue
Block a user