Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attr ¶
type Attr struct {
// K is the name of the attribute. It is commonly, "filter", "diff",
// "merge", or "text".
//
// It will never contain the special "false" shorthand ("-"), or the
// unspecify declarative ("!").
K string
// V is the value held by that attribute. It is commonly "lfs", or
// "false", indicating the special value given by a "-"-prefixed name.
V string
// Unspecified indicates whether or not this attribute was explicitly
// unset by prefixing the keyname with "!".
Unspecified bool
}
Attr is a single attribute that may be applied to a file.
type Line ¶
type Line struct {
// Pattern is a wildmatch pattern that, when matched, indicates that all
// of the below attributes (Attrs) should be applied to that tree entry.
//
// Pattern is relative to the tree in which the .gitattributes was read
// from. For example, /.gitattributes affects all blobs in the
// repository, while /path/to/.gitattributes affects all blobs that are
// direct or indirect children of /path/to.
Pattern *wildmatch.Wildmatch
// Attrs is the list of attributes to be applied when the above pattern
// matches a given filename.
//
// It is populated in-order as it was written in the .gitattributes file
// being read, from left to right.
Attrs []*Attr
}
Line carries a single line from a repository's .gitattributes file, affecting a single pattern and applying zero or more attributes.
type Tree ¶
type Tree struct {
// Lines are the lines of the .gitattributes at this level of the tree.
Lines []*Line
// Children are the named child directories in the repository.
Children map[string]*Tree
}
Tree represents the .gitattributes file at one layer of the tree in a Git repository.
Click to show internal directories.
Click to hide internal directories.