Fix git fetcher error detection logic (#3665)

Signed-off-by: Noel Georgi <git@frezbo.com>
This commit is contained in:
Noel Georgi 2018-12-13 00:38:48 +05:30 committed by Jared Quick
parent f873e60309
commit 5d87b8f94b

View file

@ -89,7 +89,7 @@ module Fetchers
def resolve_ref(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 == ''
raise "Error running '#{command_string}': #{cmd.stderr}" unless cmd.exitstatus == 0
ref = parse_ls_remote(cmd.stdout, ref_name)
if !ref
raise "Unable to resolve #{ref_name} to a specific git commit for #{@remote_url}"