Merge pull request #1195 from dousha/bugfix-unsharing-hoisted

Allow removing weak branches even if it's hoisted
This commit is contained in:
Elian Doran 2025-02-16 15:05:17 +02:00 committed by GitHub
commit 569ed0868d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,7 +159,7 @@ class BBranch extends AbstractBeccaEntity<BBranch> {
} }
} }
if (this.noteId === "root" || this.noteId === cls.getHoistedNoteId()) { if ((this.noteId === "root" || this.noteId === cls.getHoistedNoteId()) && !this.isWeak) {
throw new Error("Can't delete root or hoisted branch/note"); throw new Error("Can't delete root or hoisted branch/note");
} }