summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--internal/db/posts.go3
1 files changed, 3 insertions, 0 deletions
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