mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Add extra fault checking to git fetcher (#3239)
Raise with the stderr from `git ls-remote` if stderr is not empty. This is useful when inspec runs in CI and you do not have direct control/troublshooting options. Signed-off-by: James Stocks <jstocks@chef.io>
This commit is contained in:
parent
331d4545ce
commit
fb0a8989db
1 changed files with 3 additions and 1 deletions
|
@ -83,7 +83,9 @@ module Fetchers
|
|||
end
|
||||
|
||||
def resolve_ref(ref_name)
|
||||
cmd = shellout("git ls-remote \"#{@remote_url}\" \"#{ref_name}*\"")
|
||||
command_string = "git ls-remote \"#{@remote_url}\" \"#{ref_name}*\""
|
||||
cmd = shellout(command_string)
|
||||
raise "Error running '#{command_string}': #{cmd.stderr}" unless cmd.stderr == ''
|
||||
ref = parse_ls_remote(cmd.stdout, ref_name)
|
||||
if !ref
|
||||
raise "Unable to resolve #{ref_name} to a specific git commit for #{@remote_url}"
|
||||
|
|
Loading…
Reference in a new issue