gitattributes

package
v16.10.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Set indicates the attribute was specified, but without a state
	Set = "set"
	// Unset indicates the attribute was specified with a leading dash '-'
	Unset = "unset"
	// Unspecified indicates the attribute was not specified
	Unspecified = "unspecified"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name, State string
}

Attribute defines a single attribute. Name is the attribute and State can be either Set, Unset, or any other string value.

type Attributes

type Attributes []Attribute

Attributes is a set of attributes.

func (Attributes) IsSet

func (attrs Attributes) IsSet(name string) bool

IsSet checks if the given attribute is set to a "set" value

func (Attributes) IsUnset

func (attrs Attributes) IsUnset(name string) bool

IsUnset checks if the given attribute is set to a "unset" value

func (Attributes) StateFor

func (attrs Attributes) StateFor(name string) (string, bool)

StateFor takes an attribute name and returns whether if was specified and if so what it's state is.

type CheckAttrCmd

type CheckAttrCmd struct {
	// contains filtered or unexported fields
}

CheckAttrCmd can be used to get the gitattributes(5) for a set of files in a repo.

func CheckAttr

func CheckAttr(ctx context.Context, repo git.RepositoryExecutor, revision git.Revision, names []string) (*CheckAttrCmd, func(), error)

CheckAttr creates a CheckAttrCmd that checks the given list of attribute names.

func (CheckAttrCmd) Check

func (c CheckAttrCmd) Check(path string) (Attributes, error)

Check the attributes for the file at the given path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL