b2: on cleanup delete hide marker if it is the current file #604

This commit is contained in:
Nick Craig-Wood 2016-08-18 18:36:00 +01:00
parent 8a66930bd7
commit b4f2ada820

View File

@ -800,7 +800,12 @@ func (f *Fs) purge(oldOnly bool) error {
if !isDirectory {
fs.Stats.Checking(remote)
if oldOnly && last != remote {
fs.Debug(remote, "Not deleting current version (id %q) %q", object.ID, object.Action)
if object.Action == "hide" {
fs.Debug(remote, "Deleting current version (id %q) as it is a hide marker", object.ID)
toBeDeleted <- object
} else {
fs.Debug(remote, "Not deleting current version (id %q) %q", object.ID, object.Action)
}
} else {
fs.Debug(remote, "Deleting (id %q)", object.ID)
toBeDeleted <- object