code: func isSingleReference(repoRefs []reference.Named) bool {
  	if len(repoRefs) <= 1 {
  		return len(repoRefs) == 1
  	}
  	var singleRef reference.Named
  	canonicalRefs := map[string]struct{}{}
  	for _, repoRef := range repoRefs {
  		if _, isCanonical := repoRef.(reference.Canonical); isCanonical {
  			canonicalRefs[repoRef.Name()] = struct{}{}
  		} else if singleRef == nil {
  			singleRef = repoRef
  		} else {
  			return false
  		}
  	}
  	if singleRef == nil {
  		// Just use first canonical ref
  		singleRef = repoRefs[0]
  	}
  	_, ok := canonicalRefs[singleRef.Name()]
  	return len(canonicalRefs) == 1 && ok
  }
docs: // isSingleReference returns true when all references are from one repository
  // and there is at most one tag. Returns false for empty input.