From 9f8cdac0aa4b4ca4dd73979726cd2ff8b7505493 Mon Sep 17 00:00:00 2001 From: Yap Sok Ann Date: Wed, 16 Oct 2013 20:18:01 +0800 Subject: [PATCH] git: Handle network problem when running `git ls-remote`. --- library/source_control/git | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/source_control/git b/library/source_control/git index 569a26875bd..a22c9cabdfa 100644 --- a/library/source_control/git +++ b/library/source_control/git @@ -175,7 +175,7 @@ def get_remote_head(git_path, module, dest, version, remote): def is_remote_tag(git_path, module, dest, remote, version): cmd = '%s ls-remote %s -t refs/tags/%s' % (git_path, remote, version) - (rc, out, err) = module.run_command(cmd) + (rc, out, err) = module.run_command(cmd, check_rc=True) if version in out: return True else: @@ -194,7 +194,7 @@ def get_branches(git_path, module, dest): def is_remote_branch(git_path, module, dest, remote, version): cmd = '%s ls-remote %s -h refs/heads/%s' % (git_path, remote, version) - (rc, out, err) = module.run_command(cmd) + (rc, out, err) = module.run_command(cmd, check_rc=True) if version in out: return True else: