Module: EacLauncher::Git::Base::Subrepo

Included in:
EacLauncher::Git::Base
Defined in:
lib/eac_launcher/git/base/subrepo.rb

Instance Method Summary collapse

Instance Method Details

#subrepo_remote_url(subrepo_path) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/eac_launcher/git/base/subrepo.rb', line 19

def subrepo_remote_url(subrepo_path)
  h = subrepo_status(subrepo_path)
  url = h['Remote URL']
  return url if url.present?

  raise "Remote URL is blank for subrepo \"#{subrepo_path}\" (Subrepo status: #{h})"
end

#subrepo_status(subrepo_path) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/eac_launcher/git/base/subrepo.rb', line 9

def subrepo_status(subrepo_path)
  s = execute!('subrepo', 'status', subrepo_path.gsub(%r{\A/}, ''))
  raise s.strip.to_s if s.include?('is not a subrepo')

  r = subrepo_status_parse_output(s)
  raise "Empty subrepo status for |#{s}|\n" unless r.any?

  r
end