aboutsummaryrefslogtreecommitdiffstats
path: root/utils/merkletrie/index
diff options
context:
space:
mode:
authorpaul.t <paul.t@gembaadvantage.com>2021-12-15 06:32:38 +0000
committerpaul.t <paul.t@gembaadvantage.com>2021-12-15 06:32:38 +0000
commit8d923a6fb77d7916da2df33e5a65e038cceef4e1 (patch)
tree5a823fa6e7ffd5e38df105cadcab5a0d6b7475e9 /utils/merkletrie/index
parentb0f5eb894deb6d6a1051d697f0809082abfad395 (diff)
parent53a714bdc90026135e2f2ada1c4d6c925b2733cd (diff)
downloadgo-git-8d923a6fb77d7916da2df33e5a65e038cceef4e1.tar.gz
Merge branch 'master' into codecommit-ref-delta
Diffstat (limited to 'utils/merkletrie/index')
-rw-r--r--utils/merkletrie/index/node.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/merkletrie/index/node.go b/utils/merkletrie/index/node.go
index d05b0c6..c1809f7 100644
--- a/utils/merkletrie/index/node.go
+++ b/utils/merkletrie/index/node.go
@@ -19,6 +19,7 @@ type node struct {
entry *index.Entry
children []noder.Noder
isDir bool
+ skip bool
}
// NewRootNode returns the root node of a computed tree from a index.Index,
@@ -39,7 +40,7 @@ func NewRootNode(idx *index.Index) noder.Noder {
continue
}
- n := &node{path: fullpath}
+ n := &node{path: fullpath, skip: e.SkipWorktree}
if fullpath == e.Name {
n.entry = e
} else {
@@ -58,6 +59,10 @@ func (n *node) String() string {
return n.path
}
+func (n *node) Skip() bool {
+ return n.skip
+}
+
// Hash the hash of a filesystem is a 24-byte slice, 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