Skip to content

Commit 7133834

Browse files
committed
Additionally check if path changed to trigger pure rename operation
1 parent 3348c04 commit 7133834

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/repo/editor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func editFilePost(ctx *context.Context, form forms.EditRepoFileForm, isNewFile b
297297
operation := "update"
298298
if isNewFile {
299299
operation = "create"
300-
} else if !form.Content.Has() {
300+
} else if !form.Content.Has() && ctx.Repo.TreePath != form.TreePath {
301301
// The form content only has data if file is representable as text, is not too large and not in lfs. If it doesn't
302302
// have data, the only possible operation is a rename
303303
operation = "rename"

0 commit comments

Comments
 (0)