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

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

Instance Method Summary collapse

Instance Method Details

#assert_remote_url(remote_name, url) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/avm/launcher/git/base/remotes.rb', line 24

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::Launcher::Git::Remote



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

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

#remote_branch_sha(remote_name, branch_name) ⇒ Object



33
34
35
# File 'lib/avm/launcher/git/base/remotes.rb', line 33

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

#remote_exist?(remote_name) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/avm/launcher/git/base/remotes.rb', line 20

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

#remote_hashs(remote_name) ⇒ Object



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

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