fix: branches use branch name api

This commit is contained in:
2022-01-07 15:41:50 +08:00
parent 7a1e6cfbad
commit 2a09ced1ce
2 changed files with 22 additions and 20 deletions

View File

@@ -82,8 +82,9 @@ class ProjectsController < ApplicationController
def branches
return @branches = [] unless @project.forge?
result = Gitea::Repository::Branches::ListService.call(@owner, @project.identifier)
@branches = result.is_a?(Hash) && result.key?(:status) ? [] : result
# result = Gitea::Repository::Branches::ListService.call(@owner, @project.identifier)
result = Gitea::Repository::Branches::ListNameService.call(@owner, @project.identifier)
@branches = result.is_a?(Hash) ? (result.key?(:status) ? [] : result["branch_name"]) : result
end
def branches_slice