Class: Overcommit::GitRepo::SubmoduleStatus
- Inherits:
-
Struct
- Object
- Struct
- Overcommit::GitRepo::SubmoduleStatus
- Defined in:
- lib/overcommit/git_repo.rb
Overview
Struct encapsulating submodule information extracted from the output of ‘git submodule status`
Instance Attribute Summary collapse
-
#describe ⇒ Object
Returns the value of attribute describe.
-
#path ⇒ Object
Returns the value of attribute path.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#sha1 ⇒ Object
Returns the value of attribute sha1.
Instance Method Summary collapse
-
#merge_conflict? ⇒ Boolean
Returns whether the submodule reference has a merge conflict.
-
#outdated? ⇒ Boolean
Returns whether the submodule is out of date with the current index, i.e.
-
#uninitialized? ⇒ Boolean
Returns whether the submodule has not been initialized.
Instance Attribute Details
#describe ⇒ Object
Returns the value of attribute describe
29 30 31 |
# File 'lib/overcommit/git_repo.rb', line 29 def describe @describe end |
#path ⇒ Object
Returns the value of attribute path
29 30 31 |
# File 'lib/overcommit/git_repo.rb', line 29 def path @path end |
#prefix ⇒ Object
Returns the value of attribute prefix
29 30 31 |
# File 'lib/overcommit/git_repo.rb', line 29 def prefix @prefix end |
#sha1 ⇒ Object
Returns the value of attribute sha1
29 30 31 |
# File 'lib/overcommit/git_repo.rb', line 29 def sha1 @sha1 end |
Instance Method Details
#merge_conflict? ⇒ Boolean
Returns whether the submodule reference has a merge conflict
43 44 45 |
# File 'lib/overcommit/git_repo.rb', line 43 def merge_conflict? prefix == 'U' end |
#outdated? ⇒ Boolean
Returns whether the submodule is out of date with the current index, i.e. its checked-out commit differs from that stored in the index of the parent repo
38 39 40 |
# File 'lib/overcommit/git_repo.rb', line 38 def outdated? prefix == '+' end |
#uninitialized? ⇒ Boolean
Returns whether the submodule has not been initialized
31 32 33 |
# File 'lib/overcommit/git_repo.rb', line 31 def uninitialized? prefix == '-' end |