def ls_remote(cwd=None, remote='origin', ref=None, opts='', user=None, password=None, identity=None, https_user=None, https_pass=None, ignore_retcode=False, saltenv='base'):
 if (cwd is not None):
  cwd = _expand_path(cwd, user)
 try:
  remote = salt.utils.url.add_http_basic_auth(remote, https_user, https_pass, https_only=True)
 except ValueError as exc:
  raise SaltInvocationError(exc.__str__())
 command = ['git', 'ls-remote']
 command.extend(_format_opts(opts))
 if (not isinstance(remote, six.string_types)):
  remote = str(remote)
 command.extend([remote])
 if ref:
  if (not isinstance(ref, six.string_types)):
   ref = str(ref)
  command.extend([ref])
 output = _git_run(command, cwd=cwd, user=user, password=password, identity=identity, ignore_retcode=ignore_retcode, saltenv=saltenv)['stdout']
 ret = {}
 for line in output.splitlines():
  try:
   (ref_sha1, ref_name) = line.split(None, 1)
  except IndexError:
   continue
  ret[ref_name] = ref_sha1
 return ret

def ls_remote ( cwd = None , remote = 'origin' , ref = None , opts = '' , user = None , password = None , identity = None , https_user = None , https_pass = None , ignore_retcode = False , saltenv = 'base' ) : if ( cwd is not None ) : cwd = _expand_path ( cwd , user ) try : remote = salt . utils . url . add_http_basic_auth ( remote , https_user , https_pass , https_only = True ) except ValueError as exc : raise SaltInvocationError ( exc . __str__ ( ) ) command = [ 'git' , 'ls-remote' ] command . extend ( _format_opts ( opts ) ) if ( not isinstance ( remote , six . string_types ) ) : remote = str ( remote ) command . extend ( [ remote ] ) if ref : if ( not isinstance ( ref , six . string_types ) ) : ref = str ( ref ) command . extend ( [ ref ] ) output = _git_run ( command , cwd = cwd , user = user , password = password , identity = identity , ignore_retcode = ignore_retcode , saltenv = saltenv ) [ 'stdout' ] ret = { } for line in output . splitlines ( ) : try : ( ref_sha1 , ref_name ) = line . split ( None , 1 ) except IndexError : continue ret [ ref_name ] = ref_sha1 return ret
list the refs in a remote .