def list_refs(refnames=None, repo_dir=None, limit_to_heads=False, limit_to_tags=False):
 argv = ['git', 'show-ref']
 if limit_to_heads:
  argv.append('--heads')
 if limit_to_tags:
  argv.append('--tags')
 argv.append('--')
 if refnames:
  argv += refnames
 p = subprocess.Popen(argv, preexec_fn=_gitenv(repo_dir), stdout=subprocess.PIPE)
 out = p.stdout.read().strip()
 rv = p.wait()
 if rv:
  assert (not out)
 if out:
  for d in out.split('\n'):
   (sha, name) = d.split(' ', 1)
   (yield (name, sha.decode('hex')))

def list_refs ( refnames = None , repo_dir = None , limit_to_heads = False , limit_to_tags = False ) : argv = [ 'git' , 'show-ref' ] if limit_to_heads : argv . append ( '--heads' ) if limit_to_tags : argv . append ( '--tags' ) argv . append ( '--' ) if refnames : argv += refnames p = subprocess . Popen ( argv , preexec_fn = _gitenv ( repo_dir ) , stdout = subprocess . PIPE ) out = p . stdout . read ( ) . strip ( ) rv = p . wait ( ) if rv : assert ( not out ) if out : for d in out . split ( '\n' ) : ( sha , name ) = d . split ( ' ' , 1 ) ( yield ( name , sha . decode ( 'hex' ) ) )
yield tuples for all repository refs unless refnames are specified .