From 3ae73ebf06e8d033b99dc1e0f9be9103bc8cd2af Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 13 Apr 2026 14:58:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=9C=80=E9=AA=8C=E8=AF=81=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=AF=E5=90=A6=E4=B8=BAbase64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/gitea/repository/entries/create_service.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/gitea/repository/entries/create_service.rb b/app/services/gitea/repository/entries/create_service.rb index 406106744..6a80e1d62 100644 --- a/app/services/gitea/repository/entries/create_service.rb +++ b/app/services/gitea/repository/entries/create_service.rb @@ -61,7 +61,9 @@ class Gitea::Repository::Entries::CreateService < Gitea::ClientService else if json_parse!(body)["message"].present? && json_parse!(body)["message"].starts_with?("branch already exists") error("#{@body[:new_branch]}分支已存在!") - else + elsif json_parse!(body)["message"].present? && json_parse!(body)["message"].starts_with?("illegal base64 data at input byte 4") + error("文件内容必须是base64编码的!") + else error("#{filepath}文件已存在,不能重复创建!") end end