Class: Overcommit::HookContext::PrePush::PushedRef
- Inherits:
-
Struct
- Object
- Struct
- Overcommit::HookContext::PrePush::PushedRef
- Defined in:
- lib/overcommit/hook_context/pre_push.rb
Instance Attribute Summary collapse
-
#local_ref ⇒ Object
Returns the value of attribute local_ref.
-
#local_sha1 ⇒ Object
Returns the value of attribute local_sha1.
-
#remote_ref ⇒ Object
Returns the value of attribute remote_ref.
-
#remote_sha1 ⇒ Object
Returns the value of attribute remote_sha1.
Instance Method Summary collapse
Instance Attribute Details
#local_ref ⇒ Object
Returns the value of attribute local_ref
20 21 22 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 20 def local_ref @local_ref end |
#local_sha1 ⇒ Object
Returns the value of attribute local_sha1
20 21 22 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 20 def local_sha1 @local_sha1 end |
#remote_ref ⇒ Object
Returns the value of attribute remote_ref
20 21 22 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 20 def remote_ref @remote_ref end |
#remote_sha1 ⇒ Object
Returns the value of attribute remote_sha1
20 21 22 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 20 def remote_sha1 @remote_sha1 end |
Instance Method Details
#created? ⇒ Boolean
25 26 27 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 25 def created? remote_sha1 == '0' * 40 end |
#deleted? ⇒ Boolean
29 30 31 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 29 def deleted? local_sha1 == '0' * 40 end |
#destructive? ⇒ Boolean
33 34 35 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 33 def destructive? deleted? || forced? end |
#forced? ⇒ Boolean
21 22 23 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 21 def forced? !(created? || deleted? || overwritten_commits.empty?) end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/overcommit/hook_context/pre_push.rb', line 37 def to_s "#{local_ref} #{local_sha1} #{remote_ref} #{remote_sha1}" end |