Class: Overcommit::HookContext::PostRewrite

Inherits:
Base
  • Object
show all
Defined in:
lib/overcommit/hook_context/post_rewrite.rb

Overview

Contains helpers for contextual information used by post-rewrite hooks.

Instance Method Summary collapse

Methods inherited from Base

#cleanup_environment, #hook_class_name, #hook_script_name, #hook_type_name, #initialize, #input_lines, #modified_files, #setup_environment

Constructor Details

This class inherits a constructor from Overcommit::HookContext::Base

Instance Method Details

#amend?true, false

Returns whether this post-rewrite was triggered by ‘git commit –amend`.

Returns:

  • (true, false)


7
8
9
# File 'lib/overcommit/hook_context/post_rewrite.rb', line 7

def amend?
  @args[0] == 'amend'
end

#rebase?true, false

Returns whether this post-rewrite was triggered by ‘git rebase`.

Returns:

  • (true, false)


14
15
16
# File 'lib/overcommit/hook_context/post_rewrite.rb', line 14

def rebase?
  @args[0] == 'rebase'
end