1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-22 08:25:38 +00:00

cmd/gomtree/main.go: Handle Extra and Missing cases

The BSD format needed a slight tweak to handle mtree.Extra
and mtree.Missing cases.  It currently only handled the 'Modified'
cases and therefore was not showing missing or extra files during
validation.
This commit is contained in:
Brent Baude 2016-11-16 16:14:53 -06:00 committed by Vincent Batts
parent b6ed8e415d
commit 1b0ba0d70f

View file

@ -291,6 +291,10 @@ var formats = map[string]func([]mtree.InodeDelta) string{
for _, delta := range d { for _, delta := range d {
if delta.Type() == mtree.Modified { if delta.Type() == mtree.Modified {
fmt.Fprintln(&buffer, delta) fmt.Fprintln(&buffer, delta)
} else if delta.Type() == mtree.Missing {
fmt.Fprintln(&buffer, delta)
} else if delta.Type() == mtree.Extra {
fmt.Fprintln(&buffer, delta)
} }
} }
return buffer.String() return buffer.String()