shithub: furgit

ref: df1f2fb3daa1acd25c88510f259d5535fb482126
dir: /object/store/loose/quarantine_discard.go/

View raw version
package loose

// Discard removes the quarantine and invalidates the receiver.
func (quarantine *objectQuarantine) Discard() error {
	closeErr := quarantine.Close()
	tempRootErr := quarantine.tempRoot.Close()
	removeErr := quarantine.parent.root.RemoveAll(quarantine.tempName)

	if closeErr != nil {
		return closeErr
	}

	if tempRootErr != nil {
		return tempRootErr
	}

	return removeErr
}