def branch_list(repo):
 with open_repo_closing(repo) as r:
  return r.refs.keys(base='refs/heads/')

def branch_list ( repo ) : with open_repo_closing ( repo ) as r : return r . refs . keys ( base = 'refs/heads/' )
return a list of local or remote branches this explicitly removes head from the list of remote branches .