shithub: furgit

ref: ab174c473618dd3743881cf44e02c2db4d1ecd5f
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
}