From d5c141f89207a8b22c3eebfa43be9d3b5ec18703 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 28 Jul 2022 15:19:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Apulls=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/{ => pulls}/pulls_controller.rb | 2 +- app/services/api/v1/projects/contents/batch_create_service.rb | 2 +- app/views/api/v1/projects/pulls/{ => pulls}/index.json.jbuilder | 0 app/views/api/v1/projects/pulls/{ => pulls}/show.json.jbuilder | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename app/controllers/api/v1/projects/{ => pulls}/pulls_controller.rb (89%) rename app/views/api/v1/projects/pulls/{ => pulls}/index.json.jbuilder (100%) rename app/views/api/v1/projects/pulls/{ => pulls}/show.json.jbuilder (100%) diff --git a/app/controllers/api/v1/projects/pulls_controller.rb b/app/controllers/api/v1/projects/pulls/pulls_controller.rb similarity index 89% rename from app/controllers/api/v1/projects/pulls_controller.rb rename to app/controllers/api/v1/projects/pulls/pulls_controller.rb index c93cd8bd8..1a7c574d9 100644 --- a/app/controllers/api/v1/projects/pulls_controller.rb +++ b/app/controllers/api/v1/projects/pulls/pulls_controller.rb @@ -1,4 +1,4 @@ -class Api::V1::Projects::PullsController < Api::V1::BaseController +class Api::V1::Projects::Pulls::PullsController < Api::V1::BaseController before_action :require_public_and_member_above def index 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 464f8eec9..92bd30a99 100644 --- a/app/services/api/v1/projects/contents/batch_create_service.rb +++ b/app/services/api/v1/projects/contents/batch_create_service.rb @@ -86,7 +86,7 @@ class Api::V1::Projects::Contents::BatchCreateService < ApplicationService result = $gitea_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, '分支已存在!' if result['branch_name'].include?(new_branch) && !new_branch.nil? end end \ No newline at end of file diff --git a/app/views/api/v1/projects/pulls/index.json.jbuilder b/app/views/api/v1/projects/pulls/pulls/index.json.jbuilder similarity index 100% rename from app/views/api/v1/projects/pulls/index.json.jbuilder rename to app/views/api/v1/projects/pulls/pulls/index.json.jbuilder diff --git a/app/views/api/v1/projects/pulls/show.json.jbuilder b/app/views/api/v1/projects/pulls/pulls/show.json.jbuilder similarity index 100% rename from app/views/api/v1/projects/pulls/show.json.jbuilder rename to app/views/api/v1/projects/pulls/pulls/show.json.jbuilder