Class: Moku::SCM::Git::RemoteResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/moku/scm/git/remote_resolver.rb

Overview

Git ref resolver for remote repositories.

Instance Method Summary collapse

Constructor Details

#initialize(system_runner) ⇒ RemoteResolver

Returns a new instance of RemoteResolver.


9
10
11
# File 'lib/moku/scm/git/remote_resolver.rb', line 9

def initialize(system_runner)
  @system_runner = system_runner
end

Instance Method Details

#sha(url, commitish) ⇒ Object


13
14
15
16
17
18
19
20
# File 'lib/moku/scm/git/remote_resolver.rb', line 13

def sha(url, commitish)
  system_runner.run("git ls-remote #{url} #{commitish}")
    .output
    .split("\n")
    .first
    &.split
    &.first
end