Class: Overcommit::HookContext::PostRewrite
- Defined in:
- lib/overcommit/hook_context/post_rewrite.rb
Overview
Contains helpers for contextual information used by post-rewrite hooks.
Instance Method Summary collapse
-
#amend? ⇒ true, false
Returns whether this post-rewrite was triggered by ‘git commit –amend`.
-
#rebase? ⇒ true, false
Returns whether this post-rewrite was triggered by ‘git rebase`.
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`.
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`.
14 15 16 |
# File 'lib/overcommit/hook_context/post_rewrite.rb', line 14 def rebase? @args[0] == 'rebase' end |