修复:批量修改文件查询分支Hash to Array

This commit is contained in:
yystopf 2023-03-20 10:11:20 +08:00
parent c02ea218b3
commit a630753485
1 changed files with 3 additions and 3 deletions

View File

@ -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