Merge branch 'hh_gitea_upgrade' into feature_gitea_upgrade

This commit is contained in:
yystopf 2023-03-20 16:14:43 +08:00
commit 230ab8e937
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