Class: R10K::Git::Head Private

Inherits:
Ref
  • Object
show all
Defined in:
lib/r10k/git/head.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.

head: A named reference to the commit at the tip of a branch. Heads are stored in a file in $GIT_DIR/refs/heads/ directory. except when using packed

Direct Known Subclasses

RemoteHead

Instance Attribute Summary collapse

Attributes inherited from Ref

#repository

Instance Method Summary collapse

Methods inherited from Ref

#==, #inspect, #resolvable?, #sha1, #to_s

Constructor Details

#initialize(head, repository = nil) ⇒ Head

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 a new instance of Head.



18
19
20
21
# File 'lib/r10k/git/head.rb', line 18

def initialize(head, repository = nil)
  @head = head
  @repository = repository
end

Instance Attribute Details

#headObject (readonly) Also known as: ref

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.



15
16
17
# File 'lib/r10k/git/head.rb', line 15

def head
  @head
end

Instance Method Details

#fetch?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.

If we are tracking a branch, we should always try to fetch a newer version of that branch.

Returns:

  • (Boolean)


30
31
32
# File 'lib/r10k/git/head.rb', line 30

def fetch?
  true
end