parameters: (remote)
return_statement: return ret
docstring: Fetch a dictionary mapping branch name to SHA1 hash from the given remote.
docstring_summary: Fetch a dictionary mapping branch name to SHA1 hash from the given remote.
docstring_tokens: Fetch a dictionary mapping branch name to SHA1 hash from the given remote .
function: def get_branches(remote):
    """ Fetch a dictionary mapping branch name to SHA1 hash from the given remote. """
    out = check_output(["git", "ls-remote", remote, "refs/heads/*"]).decode('utf-8')
    ret = {}
    for l in out.splitlines():
      sha, ref = l.split("\t")
      branch = ref.replace("refs/heads/", "", 1)
      ret[branch] = sha
    return ret
function_tokens: def get_branches ( remote ) : out = check_output ( [ "git" , "ls-remote" , remote , "refs/heads/*" ] ) . decode ( 'utf-8' ) ret = { } for l in out . splitlines ( ) : sha , ref = l . split ( "\t" ) branch = ref . replace ( "refs/heads/" , "" , 1 ) ret [ branch ] = sha return ret