Store shadow nodes

This commit is contained in:
Alex Yatskov 2015-05-26 13:23:08 +09:00
parent fddafc01d6
commit 6343fa4d89
2 changed files with 6 additions and 4 deletions

View File

@ -31,9 +31,10 @@ import (
)
type versionedNode struct {
path string
info os.FileInfo
ver *version
path string
info os.FileInfo
ver *version
shadow *versionedNode
}
type versionedNodeMap map[string]*versionedNode
@ -48,7 +49,7 @@ func newVersionedNode(path string, ver *version) (*versionedNode, error) {
}
func newVersionedNodeStat(path string, ver *version, info os.FileInfo) *versionedNode {
return &versionedNode{path, info, ver}
return &versionedNode{path, info, ver, nil}
}
func (this *versionedNode) rebasedPath() string {

View File

@ -114,6 +114,7 @@ func (this *version) scanDir(path string) (versionedNodeMap, error) {
}
for ownName, ownNode := range ownNodes {
ownNode.shadow = baseNodes[ownName]
baseNodes[ownName] = ownNode
}