Merge branch 'develop' into standalone_develop

This commit is contained in:
2022-04-26 17:17:05 +08:00
6 changed files with 16 additions and 13 deletions

View File

@@ -88,7 +88,7 @@ class ProjectsController < ApplicationController
return @branches = [] unless @project.forge?
# result = Gitea::Repository::Branches::ListService.call(@owner, @project.identifier)
result = Gitea::Repository::Branches::ListNameService.call(@owner, @project.identifier)
result = Gitea::Repository::Branches::ListNameService.call(@owner, @project.identifier, params[:name])
@branches = result.is_a?(Hash) ? (result.key?(:status) ? [] : result["branch_name"]) : result
end

View File

@@ -29,7 +29,7 @@ class PullRequestsController < ApplicationController
end
def new
@all_branches = Branches::ListService.call(@owner, @project)
@all_branches = Branches::ListService.call(@owner, @project, params[:branch_name])
@is_fork = @project.forked_from_project_id.present?
@projects_names = [{
project_user_login: @owner.try(:login),
@@ -50,7 +50,7 @@ class PullRequestsController < ApplicationController
end
def get_branches
branch_result = Branches::ListService.call(@owner, @project)
branch_result = Branches::ListService.call(@owner, @project, params[:name])
render json: branch_result
# return json: branch_result
end

View File

@@ -14,7 +14,7 @@ class VersionReleasesController < ApplicationController
def new
#获取所有的分支
@all_branches = []
get_all_branches = Gitea::Repository::Branches::ListService.new(@user, @repository.try(:identifier)).call
get_all_branches = Gitea::Repository::Branches::ListService.new(@user, @repository.try(:identifier), params[:branch_name]).call
if get_all_branches && get_all_branches.size > 0
get_all_branches.each do |b|
@all_branches.push(b["name"])