code: func currentRefToMigrate() (*git.Ref, error) {
  	current, err := git.CurrentRef()
  	if err != nil {
  		return nil, err
  	}
  
  	if current.Type == git.RefTypeOther ||
  		current.Type == git.RefTypeRemoteBranch {
  
  		return nil, errors.Errorf("fatal: cannot migrate non-local ref: %s", current.Name)
  	}
  	return current, nil
  }
docs: // currentRefToMigrate returns the fully-qualified name of the currently
  // checked-out reference, or an error if the reference's type was not a local
  // branch.