Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotExist indicates that the requested tree does not exist, either because the revision // is invalid or because the path is not valid. ErrNotExist = errors.New("invalid object name") // ErrNotTreeish indicates that the requested revision or path does not resolve to a tree // object. ErrNotTreeish = errors.New("not treeish") )
View Source
var ErrParse = errors.New("failed to parse git ls-tree response")
ErrParse is returned when the parse of an entry was unsuccessful
Functions ¶
This section is empty.
Types ¶
type Entries ¶
type Entries []Entry
Entries holds every ls-tree Entry
type Entry ¶
type Entry struct { Mode []byte Type ObjectType ObjectID git.ObjectID Path string }
Entry represents a single ls-tree entry
func ListEntries ¶ added in v14.5.0
func ListEntries( ctx context.Context, repo *localrepo.Repo, treeish git.Revision, cfg *ListEntriesConfig, ) ([]*Entry, error)
ListEntries lists tree entries for the given treeish. By default, this will do a non-recursive listing starting from the root of the given treeish. This behaviour can be changed by passing a config.
type ListEntriesConfig ¶ added in v14.5.0
type ListEntriesConfig struct { // Recursive indicates whether the listing shall be recursive or not. Recursive bool // RelativePath is the relative path at which listing of entries should be started. RelativePath string }
ListEntriesConfig is configuration that can be passed to ListEntries.
type ObjectType ¶
type ObjectType int
ObjectType is an Enum for the type of object of the ls-tree entry, which can be can be tree, blob or commit
const ( Tree ObjectType = iota Blob Submodule )
Enum values for ObjectType
Click to show internal directories.
Click to hide internal directories.