check: simplify Compare
Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
parent
d42d5761a6
commit
98824a87da
1 changed files with 2 additions and 7 deletions
9
check.go
9
check.go
|
@ -8,19 +8,14 @@ package mtree
|
||||||
// keywords) and then doing a Compare(dh, newDh, keywords).
|
// keywords) and then doing a Compare(dh, newDh, keywords).
|
||||||
func Check(root string, dh *DirectoryHierarchy, keywords []Keyword) ([]InodeDelta, error) {
|
func Check(root string, dh *DirectoryHierarchy, keywords []Keyword) ([]InodeDelta, error) {
|
||||||
if keywords == nil {
|
if keywords == nil {
|
||||||
used := dh.UsedKeywords()
|
keywords = dh.UsedKeywords()
|
||||||
newDh, err := Walk(root, nil, used)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return Compare(dh, newDh, used)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newDh, err := Walk(root, nil, keywords)
|
newDh, err := Walk(root, nil, keywords)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// TODO: Handle tar_time, if necessary.
|
|
||||||
return Compare(dh, newDh, keywords)
|
return Compare(dh, newDh, keywords)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue