@ -223,7 +223,7 @@ from distutils.version import LooseVersion
from ansible . module_utils . basic import AnsibleModule , get_module_path
from ansible . module_utils . basic import AnsibleModule , get_module_path
from ansible . module_utils . known_hosts import add_git_host_key
from ansible . module_utils . known_hosts import add_git_host_key
from ansible . module_utils . six import b , string_types
from ansible . module_utils . six import b , string_types
from ansible . module_utils . _text import to_ bytes, to_ native
from ansible . module_utils . _text import to_ native
def head_splitter ( headfile , remote , module = None , fail_on_error = False ) :
def head_splitter ( headfile , remote , module = None , fail_on_error = False ) :
@ -519,7 +519,7 @@ def get_tags(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 , check_rc = True , cwd = dest )
( rc , out , err ) = module . run_command ( cmd , check_rc = True , cwd = dest )
if to_ bytes ( version , errors = ' surrogate_or_strict ' ) in out :
if to_ native ( version , errors = ' surrogate_or_strict ' ) in out :
return True
return True
else :
else :
return False
return False