From a6307534854f4c6367e0a0d1f56c16b0a3446c0d Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 20 Mar 2023 10:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E6=9F=A5=E8=AF=A2=E5=88=86?= =?UTF-8?q?=E6=94=AFHash=20to=20Array?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/v1/projects/contents/batch_create_service.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/api/v1/projects/contents/batch_create_service.rb b/app/services/api/v1/projects/contents/batch_create_service.rb index 7c514c376..6503fd88c 100644 --- a/app/services/api/v1/projects/contents/batch_create_service.rb +++ b/app/services/api/v1/projects/contents/batch_create_service.rb @@ -84,9 +84,9 @@ class Api::V1::Projects::Contents::BatchCreateService < ApplicationService def check_branch_exist result = $gitea_hat_client.get_repos_branch_name_set_by_owner_repo(owner, repo, {query: request_params} ) rescue nil - raise Error, '查询分支名称失败!' unless result.is_a?(Hash) - raise Error, '分支不存在!' unless result['branch_name'].include?(branch) - raise Error, '分支已存在!' if result['branch_name'].include?(new_branch) && !new_branch.nil? + raise Error, '查询分支名称失败!' unless result.is_a?(Array) + raise Error, '分支不存在!' unless result.include?(branch) + raise Error, '分支已存在!' if result.include?(new_branch) && !new_branch.nil? end end \ No newline at end of file