From 93cf0729ec7cf3129de0808cbcc3403b86d86fff Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 21:33:39 +0200 Subject: plan 9: an interrupted or failed undo can be finished --- cmd/krino/undo.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmd/krino/undo.go') diff --git a/cmd/krino/undo.go b/cmd/krino/undo.go index b7a139f..c942ae1 100644 --- a/cmd/krino/undo.go +++ b/cmd/krino/undo.go @@ -97,6 +97,12 @@ func cmdUndo(g *globals, args []string, stdout, stderr io.Writer) int { return 0 } runID = runs[0].ID + // The most recent run is itself an undo: continue it, by planning the + // run it undid again - reversals it completed are not offered twice + // (review M10). Naming an undo run explicitly is still refused. + if runs[0].UndoOf != "" { + runID = runs[0].UndoOf + } } // PlanUndo only reads the log; nothing is touched yet (spec ยง10), which -- cgit v1.3