Class: Librarian::Source::Git::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/librarian/puppet/source/git.rb

Instance Method Summary collapse

Instance Method Details

#hash_from(remote, reference) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/librarian/puppet/source/git.rb', line 10

def hash_from(remote, reference)
  branch_names = remote_branch_names[remote]
  reference = "#{remote}/#{reference}" if branch_names.include?(reference)

  command = %W[rev-parse #{reference}^{commit} --quiet]
  run!(command, chdir: true).strip
end