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:
parent
e418c93291
commit
662a52296c
6
hypha.go
6
hypha.go
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user