mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-21 16:05:40 +00:00
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).
|
||||
func Check(root string, dh *DirectoryHierarchy, keywords []Keyword) ([]InodeDelta, error) {
|
||||
if keywords == nil {
|
||||
used := dh.UsedKeywords()
|
||||
newDh, err := Walk(root, nil, used)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return Compare(dh, newDh, used)
|
||||
keywords = dh.UsedKeywords()
|
||||
}
|
||||
|
||||
newDh, err := Walk(root, nil, keywords)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// TODO: Handle tar_time, if necessary.
|
||||
|
||||
return Compare(dh, newDh, keywords)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue