Module: Avm::Git::Launcher::Base::Remotes

Included in:
Avm::Git::Launcher::Base
Defined in:
lib/avm/git/launcher/base/remotes.rb

Instance Method Summary collapse

Instance Method Details

#assert_remote_url(remote_name, url) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/avm/git/launcher/base/remotes.rb', line 21

def assert_remote_url(remote_name, url)
  r = git.remote(remote_name)
  if !r.url || r.url != url
    r.remove if r.url
    git.add_remote(remote_name, url)
  end
  r
end

#remote(name) ⇒ Avm::Git::Launcher::Remote



9
10
11
# File 'lib/avm/git/launcher/base/remotes.rb', line 9

def remote(name)
  ::Avm::Git::Launcher::Remote.new(self, name)
end

#remote_branch_sha(remote_name, branch_name) ⇒ Object



30
31
32
# File 'lib/avm/git/launcher/base/remotes.rb', line 30

def remote_branch_sha(remote_name, branch_name)
  remote_hashs(remote_name)["refs/heads/#{branch_name}"]
end

#remote_exist?(remote_name) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/avm/git/launcher/base/remotes.rb', line 17

def remote_exist?(remote_name)
  remote(remote_name).exist?
end

#remote_hashs(remote_name) ⇒ Object



13
14
15
# File 'lib/avm/git/launcher/base/remotes.rb', line 13

def remote_hashs(remote_name)
  remote(remote_name).ls
end