Class: KKGit::GitOps::Status
- Inherits:
-
Struct
- Object
- Struct
- KKGit::GitOps::Status
- Defined in:
- lib/kk/git/git_ops.rb
Overview
仓库同步状态快照
Instance Attribute Summary collapse
-
#ahead ⇒ Object
Returns the value of attribute ahead.
-
#behind ⇒ Object
Returns the value of attribute behind.
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#clean ⇒ Object
Returns the value of attribute clean.
-
#detached ⇒ Object
Returns the value of attribute detached.
-
#remote ⇒ Object
Returns the value of attribute remote.
-
#upstream_configured ⇒ Object
Returns the value of attribute upstream_configured.
Instance Method Summary collapse
- #behind_remote? ⇒ Boolean
-
#needs_sync? ⇒ Boolean
是否需要与远端同步(有未推送 commit 或落后远端).
- #unpushed? ⇒ Boolean
Instance Attribute Details
#ahead ⇒ Object
Returns the value of attribute ahead
12 13 14 |
# File 'lib/kk/git/git_ops.rb', line 12 def ahead @ahead end |
#behind ⇒ Object
Returns the value of attribute behind
12 13 14 |
# File 'lib/kk/git/git_ops.rb', line 12 def behind @behind end |
#branch ⇒ Object
Returns the value of attribute branch
12 13 14 |
# File 'lib/kk/git/git_ops.rb', line 12 def branch @branch end |
#clean ⇒ Object
Returns the value of attribute clean
12 13 14 |
# File 'lib/kk/git/git_ops.rb', line 12 def clean @clean end |
#detached ⇒ Object
Returns the value of attribute detached
12 13 14 |
# File 'lib/kk/git/git_ops.rb', line 12 def detached @detached end |
#remote ⇒ Object
Returns the value of attribute remote
12 13 14 |
# File 'lib/kk/git/git_ops.rb', line 12 def remote @remote end |
#upstream_configured ⇒ Object
Returns the value of attribute upstream_configured
12 13 14 |
# File 'lib/kk/git/git_ops.rb', line 12 def upstream_configured @upstream_configured end |
Instance Method Details
#behind_remote? ⇒ Boolean
26 27 28 |
# File 'lib/kk/git/git_ops.rb', line 26 def behind_remote? behind.positive? end |
#needs_sync? ⇒ Boolean
是否需要与远端同步(有未推送 commit 或落后远端)
18 19 20 |
# File 'lib/kk/git/git_ops.rb', line 18 def needs_sync? ahead.positive? || behind.positive? end |
#unpushed? ⇒ Boolean
22 23 24 |
# File 'lib/kk/git/git_ops.rb', line 22 def unpushed? ahead.positive? end |