code: func trackedFromAttrs(db *gitobj.ObjectDatabase, t *gitobj.Tree) (*tools.OrderedSet, error) {
  	var oid []byte
  
  	for _, e := range t.Entries {
  		if strings.ToLower(e.Name) == ".gitattributes" && e.Type() == gitobj.BlobObjectType {
  			oid = e.Oid
  			break
  		}
  	}
  
  	if oid == nil {
  		// TODO(@ttaylorr): make (*tools.OrderedSet)(nil) a valid
  		// receiver for non-mutative methods.
  		return tools.NewOrderedSet(), nil
  	}
  
  	sha1 := hex.EncodeToString(oid)
  
  	if s, ok := attrsCache[sha1]; ok {
  		return s, nil
  	}
  
  	blob, err := db.Blob(oid)
  	if err != nil {
  		return nil, err
  	}
  
  	attrs := tools.NewOrderedSet()
  
  	scanner := bufio.NewScanner(blob.Contents)
  	for scanner.Scan() {
  		attrs.Add(scanner.Text())
  	}
  
  	if err := scanner.Err(); err != nil {
  		return nil, err
  	}
  
  	attrsCache[sha1] = attrs
  
  	return attrsCache[sha1], nil
  }
docs: // trackedFromAttrs returns an ordered line-delimited set of the contents of a
  // .gitattributes blob in a given tree "t".
  //
  // It returns an empty set if no attributes file could be found, or an error if
  // it could not otherwise be opened.