{"modulePath":"github.com/github/git-media","version":"v2.5.2+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitattr\n\n## Types\n\n```go\ntype Attr struct {\n\t// K is the name of the attribute. It is commonly, \"filter\", \"diff\",\n\t// \"merge\", or \"text\".\n\t//\n\t// It will never contain the special \"false\" shorthand (\"-\"), or the\n\t// unspecify declarative (\"!\").\n\tK string\n\t// V is the value held by that attribute. It is commonly \"lfs\", or\n\t// \"false\", indicating the special value given by a \"-\"-prefixed name.\n\tV string\n\t// Unspecified indicates whether or not this attribute was explicitly\n\t// unset by prefixing the keyname with \"!\".\n\tUnspecified bool\n}\n```\nAttr is a single attribute that may be applied to a file.\n\n```go\ntype Line struct {\n\t// Pattern is a wildmatch pattern that, when matched, indicates that all\n\t// of the below attributes (Attrs) should be applied to that tree entry.\n\t//\n\t// Pattern is relative to the tree in which the .gitattributes was read\n\t// from. For example, /.gitattributes affects all blobs in the\n\t// repository, while /path/to/.gitattributes affects all blobs that are\n\t// direct or indirect children of /path/to.\n\tPattern *wildmatch.Wildmatch\n\t// Attrs is the list of attributes to be applied when the above pattern\n\t// matches a given filename.\n\t//\n\t// It is populated in-order as it was written in the .gitattributes file\n\t// being read, from left to right.\n\tAttrs []*Attr\n}\n```\nLine carries a single line from a repository's .gitattributes file, affecting a single pattern and applying zero or more attributes.\n\n```go\nfunc ParseLines(r io.Reader) ([]*Line, error)\n```\nParseLines parses the given io.Reader \"r\" line-wise as if it were the contents of a .gitattributes file.\n\nIf an error was encountered, it will be returned and the \\[]\\*Line should be considered unusable.\n\n```go\ntype Tree struct {\n\t// Lines are the lines of the .gitattributes at this level of the tree.\n\tLines []*Line\n\t// Children are the named child directories in the repository.\n\tChildren map[string]*Tree\n}\n```\nTree represents the .gitattributes file at one layer of the tree in a Git repository.\n\n```go\nfunc New(db *gitobj.ObjectDatabase, t *gitobj.Tree) (*Tree, error)\n```\nNew constructs a \\*Tree starting at the given tree \"t\" and reading objects from the given ObjectDatabase. If a tree was not able to be read, an error will be propagated up accordingly.\n\n```go\nfunc (t *Tree) Applied(to string) []*Attr\n```\nApplied returns a slice of attributes applied to the given path, relative to the receiving tree. It traverse through sub-trees in a topological ordering, if there are relevant .gitattributes matching that path.\n\n","path":"github.com/github/git-media/git/gitattr","name":"gitattr","synopsis":"","isRedistributable":true}
