1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-13 05:50:27 +00:00

Correctly forget about deleted hyphae

This commit is contained in:
bouncepaw 2020-10-03 19:19:49 +05:00
parent e418c93291
commit 662a52296c

View File

@ -41,11 +41,15 @@ type HyphaData struct {
// DeleteHypha deletes hypha and makes a history record about that.
func (hd *HyphaData) DeleteHypha(hyphaName string) *history.HistoryOp {
return history.Operation(history.TypeDeleteHypha).
hop := history.Operation(history.TypeDeleteHypha).
WithFilesRemoved(hd.textPath, hd.binaryPath).
WithMsg(fmt.Sprintf("Delete %s", hyphaName)).
WithSignature("anon").
Apply()
if len(hop.Errs) == 0 {
delete(HyphaStorage, hyphaName)
}
return hop
}
// RenameHypha renames hypha from old name `hyphaName` to `newName` and makes a history record about that.