From 7133834ffe1a19d81e9764db37fa344768e6cc95 Mon Sep 17 00:00:00 2001 From: bytedream Date: Thu, 8 May 2025 23:06:08 +0200 Subject: [PATCH] Additionally check if path changed to trigger pure rename operation --- routers/web/repo/editor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index 91b9c069d9..af713bbafa 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -297,7 +297,7 @@ func editFilePost(ctx *context.Context, form forms.EditRepoFileForm, isNewFile b operation := "update" if isNewFile { operation = "create" - } else if !form.Content.Has() { + } else if !form.Content.Has() && ctx.Repo.TreePath != form.TreePath { // The form content only has data if file is representable as text, is not too large and not in lfs. If it doesn't // have data, the only possible operation is a rename operation = "rename"