lib/eac_launcher/git/base/subrepo.rb in eac_launcher-0.2.0 vs lib/eac_launcher/git/base/subrepo.rb in eac_launcher-0.2.1
- old
+ new
@@ -1,14 +1,21 @@
module EacLauncher
module Git
- class Base < ::EacLauncher::Path
+ class Base < ::EacLauncher::Paths::Real
module Subrepo
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
+
+ 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
private
def subrepo_status_parse_output(s)