code: func (r *Rewriter) refsToMigrate() ([]*git.Ref, error) {
  	var refs []*git.Ref
  	var err error
  
  	if root, ok := r.db.Root(); ok {
  		refs, err = git.AllRefsIn(root)
  	} else {
  		refs, err = git.AllRefs()
  	}
  
  	if err != nil {
  		return nil, err
  	}
  
  	var local []*git.Ref
  	for _, ref := range refs {
  		if ref.Type == git.RefTypeRemoteBranch {
  			continue
  		}
  
  		local = append(local, ref)
  	}
  
  	return local, nil
  }
docs: // refsToMigrate returns a list of references to migrate, or an error if loading
  // those references failed.