diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 22:26:23 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 22:26:23 +0200 |
| commit | 21339a73f5cd592ebd92937a1440aa9f13e75bbb (patch) | |
| tree | 9b3e71e1f05e3c8cf49a34630615cb1f8c4a317c /internal/engine/apply.go | |
| parent | d50f3670bf2ccb843e9001321d072a2d5680cb2a (diff) | |
| download | krino-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.go | 8 |
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] |
