A treenoder is a helper type that wraps git trees into merkletrie noders. As a merkletrie noder doesn't understand the concept of modes (e.g. file permissions), the treenoder includes the mode of the git tree in the hash, so changes in the modes will be detected as modifications to the file content
| 17 | // to the file contents by the merkletrie difftree algorithm. This is |
| 18 | // consistent with how the "git diff-tree" command works. |
| 19 | type treeNoder struct { |
| 20 | parent *Tree // the root node is its own parent |
| 21 | name string // empty string for the root node |
| 22 | mode filemode.FileMode |
| 23 | hash plumbing.Hash |
| 24 | children []noder.Noder // memoized |
| 25 | } |
| 26 | |
| 27 | // NewTreeRootNode returns the root node of a Tree |
| 28 | func NewTreeRootNode(t *Tree) noder.Noder { |
nothing calls this directly
no outgoing calls
no test coverage detected