Class: RubyGit::Status::Branch
- Inherits:
-
Object
- Object
- RubyGit::Status::Branch
- Defined in:
- lib/ruby_git/status/branch.rb
Overview
Represents git branch information
Instance Attribute Summary collapse
-
#ahead ⇒ Integer
Number of commits ahead of upstream.
-
#behind ⇒ Integer
Number of commits behind upstream.
-
#name ⇒ String?
The name of the current branch.
-
#oid ⇒ String
The object ID (hash) of the current commit.
-
#upstream ⇒ String?
The name of the upstream branch.
Instance Method Summary collapse
-
#detached? ⇒ Boolean
Check if HEAD is detached.
-
#upstream? ⇒ Boolean
Check if the branch has an upstream configured.
Instance Attribute Details
#ahead ⇒ Integer
Number of commits ahead of upstream
55 56 57 |
# File 'lib/ruby_git/status/branch.rb', line 55 def ahead @ahead end |
#behind ⇒ Integer
Number of commits behind upstream
67 68 69 |
# File 'lib/ruby_git/status/branch.rb', line 67 def behind @behind end |
#name ⇒ String?
The name of the current branch
19 20 21 |
# File 'lib/ruby_git/status/branch.rb', line 19 def name @name end |
#oid ⇒ String
The object ID (hash) of the current commit
31 32 33 |
# File 'lib/ruby_git/status/branch.rb', line 31 def oid @oid end |
#upstream ⇒ String?
The name of the upstream branch
43 44 45 |
# File 'lib/ruby_git/status/branch.rb', line 43 def upstream @upstream end |
Instance Method Details
#detached? ⇒ Boolean
Check if HEAD is detached
87 88 89 |
# File 'lib/ruby_git/status/branch.rb', line 87 def detached? @name.nil? end |
#upstream? ⇒ Boolean
Check if the branch has an upstream configured
76 77 78 |
# File 'lib/ruby_git/status/branch.rb', line 76 def upstream? !@upstream.nil? end |