Class: Git::DetachedHeadInfo Private
- Inherits:
-
Data
- Object
- Data
- Git::DetachedHeadInfo
- Defined in:
- lib/git/detached_head_info.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Value object representing a detached HEAD state
When HEAD points directly to a commit rather than a branch reference, the repository is in a "detached HEAD" state. This object captures that state along with the commit SHA that HEAD points to.
This class shares a minimal interface with BranchInfo to allow polymorphic usage where appropriate:
short_name- returns 'HEAD'target_oid- returns the commit SHAto_s- returns 'HEAD'detached?- returns true
Work in progress; this class is internal for now and may be made public in a future release.
Instance Attribute Summary collapse
-
#target_oid ⇒ String
readonly
The commit object ID (SHA) that HEAD points to.
Instance Method Summary collapse
-
#detached? ⇒ Boolean
private
Always true for DetachedHeadInfo.
-
#short_name ⇒ String
private
Always 'HEAD'.
-
#to_s ⇒ String
private
Always 'HEAD'.
-
#unborn? ⇒ Boolean
private
Always false for DetachedHeadInfo (detached HEAD always has a commit).
Instance Attribute Details
#target_oid ⇒ String (readonly)
The commit object ID (SHA) that HEAD points to
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/git/detached_head_info.rb', line 44 DetachedHeadInfo = Data.define(:target_oid) do # @return [Boolean] always true for DetachedHeadInfo def detached? = true # @return [Boolean] always false for DetachedHeadInfo (detached HEAD always has a commit) def unborn? = false # @return [String] always 'HEAD' def short_name = 'HEAD' # @return [String] always 'HEAD' def to_s = 'HEAD' end |
Instance Method Details
#detached? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns always true for DetachedHeadInfo.
46 |
# File 'lib/git/detached_head_info.rb', line 46 def detached? = true |
#short_name ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns always 'HEAD'.
52 |
# File 'lib/git/detached_head_info.rb', line 52 def short_name = 'HEAD' |
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns always 'HEAD'.
55 |
# File 'lib/git/detached_head_info.rb', line 55 def to_s = 'HEAD' |
#unborn? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns always false for DetachedHeadInfo (detached HEAD always has a commit).
49 |
# File 'lib/git/detached_head_info.rb', line 49 def unborn? = false |