From 8b137242305bb2a39f580d994392ece195aacf3b Mon Sep 17 00:00:00 2001 From: ivar Date: Sat, 4 Apr 2026 16:12:29 +0200 Subject: fix: guard RenamePost against self-rename (noop) --- internal/db/posts.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal') diff --git a/internal/db/posts.go b/internal/db/posts.go index d391c3e..c1360ab 100644 --- a/internal/db/posts.go +++ b/internal/db/posts.go @@ -141,6 +141,9 @@ func (m *MetaDB) CollapseRedirects(oldSlug, newSlug string) error { // RenamePost atomically renames a post from oldSlug to newSlug, // updates any existing redirect chains, and adds a redirect from oldSlug to newSlug. func (m *MetaDB) RenamePost(oldSlug, newSlug string) error { + if oldSlug == newSlug { + return nil + } tx, err := m.db.Begin() if err != nil { return err -- cgit v1.3