···598598 return repo, s, err
599599}
600600601601-type repoPathRanks struct {
602602- MeanRank float64 `json:"mean_reference_count"`
603603- Paths map[string]float64 `json:"paths"`
604604-}
605605-606606-// rank returns the rank for a given path. It uses these rules:
607607-// - If we have a concrete rank for this file, always use it
608608-// - If there's no rank, and it's a low priority file like a test, then use rank 0
609609-// - Otherwise use the mean rank of this repository, to avoid giving it a big disadvantage
610610-func (r repoPathRanks) rank(path string, content []byte) float64 {
611611- if rank, ok := r.Paths[path]; ok {
612612- return rank
613613- } else if index.IsLowPriority(path, content) {
614614- return 0.0
615615- } else {
616616- return r.MeanRank
617617- }
618618-}
619619-620601func newIgnoreMatcher(tree *object.Tree) (*ignore.Matcher, error) {
621602 ignoreFile, err := tree.File(ignore.IgnoreFile)
622603 if err == object.ErrFileNotFound {