From a2cb20851499e9c00bd3bf642680a9ce3148cae8 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Thu, 17 Sep 2026 10:15:45 +0200 Subject: gui: name the other copy of a duplicate, and offer to keep this one instead --- internal/engine/match.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/engine/match.go') diff --git a/internal/engine/match.go b/internal/engine/match.go index 59cea42..25c05e5 100644 --- a/internal/engine/match.go +++ b/internal/engine/match.go @@ -46,6 +46,13 @@ type FileMatch struct { // directory's rules use, or that check failed. Only set for a file some // matching rule would delete. NoDelete string + + // DuplicateOf is the file a (duplicate) test matched this one against, + // absolute; "" when none did. The reason text says the same thing the + // way it reads best - relative to the directory when it is inside it - + // which leaves a front end no way to act on the other copy, or even to + // say where it is (his report, 2026-09-17). + DuplicateOf string } // Result is everything Match found in one directory. @@ -190,6 +197,7 @@ func evalFile(run *matchRun, file scan.File) FileMatch { if len(run.d.DupScopes) > 0 && deletes(fm.Rules) { fm.NoDelete = noDelete(f, run.d.DupScopes) } + fm.DuplicateOf = f.DuplicateOriginal() return fm } -- cgit v1.3