Please use self.repo.refs to inspect refs; that way we can make this work with in-memory repositories too.