Method: Overcommit::Hook::PrepareCommitMsg::Base#modify_commit_message
- Defined in:
- lib/overcommit/hook/prepare_commit_msg/base.rb
#modify_commit_message ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/overcommit/hook/prepare_commit_msg/base.rb', line 13 def raise 'This expects a block!' unless block_given? # NOTE: this assumes all the hooks of the same type share the context's # memory. If that's not the case, this won't work. lock.synchronize do contents = File.read() File.open(, 'w') do |f| f << (yield contents) end end end |