aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/apply.go
diff options
context:
space:
mode:
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]