1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-25 09:35:39 +00:00
go-mtree/check.go
Vincent Batts 40f4ce8108
check: remove unused TarCheck(), for Compare()
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2018-12-10 11:26:12 -05:00

20 lines
667 B
Go

package mtree
// Check a root directory path against the DirectoryHierarchy, regarding only
// the available keywords from the list and each entry in the hierarchy.
// If keywords is nil, the check all present in the DirectoryHierarchy
//
// This is equivalent to creating a new DirectoryHierarchy with Walk(root, nil,
// keywords, fs) and then doing a Compare(dh, newDh, keywords).
func Check(root string, dh *DirectoryHierarchy, keywords []Keyword, fs FsEval) ([]InodeDelta, error) {
if keywords == nil {
keywords = dh.UsedKeywords()
}
newDh, err := Walk(root, nil, keywords, fs)
if err != nil {
return nil, err
}
return Compare(dh, newDh, keywords)
}