From 21339a73f5cd592ebd92937a1440aa9f13e75bbb Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 22:26:23 +0200 Subject: plan 10: a damaged log line refuses only its file, not the run --- internal/engine/apply.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/engine/apply.go') diff --git a/internal/engine/apply.go b/internal/engine/apply.go index cc87f30..ed2fbe5 100644 --- a/internal/engine/apply.go +++ b/internal/engine/apply.go @@ -496,6 +496,14 @@ func isFileAffecting(action string) bool { // overrides a real occupant that this same chain is itself about to clear. func planUndoFile(dir, file string, ents []journal.Entry, reversed map[journal.ReversedKey]int) UndoFile { uf := UndoFile{File: file, Dir: dir} + for _, en := range ents { + if en.Action == "damaged" { + // A log line of this file is cut or damaged (journal.Entries): a + // step may be missing from its chain, so none of it is reversed. + uf.Refused = fmt.Sprintf("its log is damaged (%s); a step may not be recorded", en.Detail) + return uf + } + } proj := newUndoProjection() for i := len(ents) - 1; i >= 0; i-- { en := ents[i] -- cgit v1.3