This looks very awkward - it doesn't work to do `'refs/heads/%s' % branch_name in self._repo.refs` ?