fix deleting directory

this used to corrupt the local state (password entities remained in DB
but files/dirs were removed from git and disk)
This commit is contained in:
Lysann Tranvouez 2026-03-09 12:11:37 +01:00
parent 4405b7fe3d
commit 2c8d27df69
4 changed files with 24 additions and 0 deletions

View file

@ -273,6 +273,10 @@ public class PasswordStore {
}
public func delete(passwordEntity: PasswordEntity) throws {
if passwordEntity.isDir {
throw AppError.cannotDeleteDirectory
}
let deletedFileURL = passwordEntity.fileURL(in: storeURL)
let deletedFilePath = passwordEntity.path
try gitRm(path: passwordEntity.path)