Documentation ¶
Index ¶
- func NewRootNode(root string, m noder.Matcher) noder.Noder
- type Node
- func (n *Node) Children(ctx context.Context) ([]noder.Noder, error)
- func (n *Node) Hash() []byte
- func (n *Node) HashRaw() plumbing.Hash
- func (n *Node) HijackMode(mode filemode.FileMode)
- func (n *Node) IsDir() bool
- func (n *Node) Mode() filemode.FileMode
- func (n *Node) ModifiedAt() time.Time
- func (n *Node) Name() string
- func (n *Node) NumChildren(ctx context.Context) (int, error)
- func (n *Node) Size() int64
- func (n *Node) Skip() bool
- func (n *Node) String() string
- func (n *Node) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRootNode ¶
NewRootNode returns the root node based on a given billy.Filesystem.
In order to provide the submodule hash status, a map[string]plumbing.Hash should be provided where the key is the path of the submodule and the commit of the submodule HEAD
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
The Node represents a file or a directory in a billy.Filesystem. It implements the interface noder.Noder of merkletrie package.
This implementation implements a "standard" hash method being able to be compared with any other noder.Noder implementation inside of go-git.
func (*Node) Hash ¶
Hash the hash of a filesystem is the result of concatenating the computed plumbing.Hash of the file as a Blob and its plumbing.FileMode; that way the difftree algorithm will detect changes in the contents of files and also in their mode.
The hash of a directory is always a 36-bytes slice of zero values