1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-07-16 11:30:32 +00:00
This commit is contained in:
Vincent Batts 2018-08-13 23:09:49 -04:00
parent f34a2e0d2b
commit a072d6d6e7
2 changed files with 13 additions and 9 deletions

View file

@ -5,18 +5,18 @@ package mtree
// 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).
// keywords, fs) and then doing a Compare(dh, curDh, 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)
curDh, err := Walk(root, nil, keywords, fs)
if err != nil {
return nil, err
}
return Compare(dh, newDh, keywords)
return Compare(dh, curDh, keywords)
}
// TarCheck is the tar equivalent of checking a file hierarchy spec against a