code: func (m *matcher) Match(path []string, attributes []string) (results map[string]Attribute, matched bool) {
  	results = make(map[string]Attribute, len(attributes))
  
  	n := len(m.stack)
  	for i := n - 1; i >= 0; i-- {
  		if len(attributes) > 0 && len(attributes) == len(results) {
  			return
  		}
  
  		pattern := m.stack[i].Pattern
  		if pattern == nil {
  			continue
  		}
  
  		if match := pattern.Match(path); match {
  			matched = true
  			for _, attr := range m.stack[i].Attributes {
  				if attr.IsSet() {
  					m.expandMacro(attr.Name(), results)
  				}
  				results[attr.Name()] = attr
  			}
  		}
  	}
  	return
  }
docs: // Match matches path against the patterns in gitattributes files and returns
  // the attributes associated with the path.
  //
  // Specific attributes can be specified otherwise all attributes are returned.
  //
  // Matched is true if any path was matched to a rule, even if the results map
  // is empty.