summaryrefslogtreecommitdiff
path: root/internal/engine/apply.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 22:26:23 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 22:26:23 +0200
commit21339a73f5cd592ebd92937a1440aa9f13e75bbb (patch)
tree9b3e71e1f05e3c8cf49a34630615cb1f8c4a317c /internal/engine/apply.go
parentd50f3670bf2ccb843e9001321d072a2d5680cb2a (diff)
downloadkrino-21339a73f5cd592ebd92937a1440aa9f13e75bbb.tar.gz
krino-21339a73f5cd592ebd92937a1440aa9f13e75bbb.zip
plan 10: a damaged log line refuses only its file, not the run
Diffstat (limited to 'internal/engine/apply.go')
-rw-r--r--internal/engine/apply.go8
1 files changed, 8 insertions, 0 deletions
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]