Commit 9f8cdac0 by Yap Sok Ann

git: Handle network problem when running `git ls-remote`.

parent a53e7045
...@@ -175,7 +175,7 @@ def get_remote_head(git_path, module, dest, version, remote): ...@@ -175,7 +175,7 @@ def get_remote_head(git_path, module, dest, version, remote):
def is_remote_tag(git_path, module, dest, remote, version): def is_remote_tag(git_path, module, dest, remote, version):
cmd = '%s ls-remote %s -t refs/tags/%s' % (git_path, 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: if version in out:
return True return True
else: else:
...@@ -194,7 +194,7 @@ def get_branches(git_path, module, dest): ...@@ -194,7 +194,7 @@ def get_branches(git_path, module, dest):
def is_remote_branch(git_path, module, dest, remote, version): def is_remote_branch(git_path, module, dest, remote, version):
cmd = '%s ls-remote %s -h refs/heads/%s' % (git_path, 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: if version in out:
return True return True
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment