forked from Trustie/forgeplus
FIX repositories detail api bug
This commit is contained in:
parent
e1d7b0b881
commit
ad4617288d
|
@ -210,7 +210,7 @@ class RepositoriesController < ApplicationController
|
|||
end
|
||||
|
||||
def get_ref
|
||||
@ref = params[:ref] || @project.default_branch
|
||||
@ref = params[:ref] || @project&.default_branch
|
||||
end
|
||||
|
||||
def get_latest_commit
|
||||
|
|
|
@ -41,11 +41,13 @@ class Repositories::DetailService < ApplicationService
|
|||
end
|
||||
|
||||
def branch_suitable
|
||||
Gitea::Repository::Branches::ListService.call(@owner, @repo.identifier)
|
||||
branches = Gitea::Repository::Branches::ListService.call(@owner, @repo.identifier)
|
||||
branches.is_a?(Hash) && branches[:status] == :error ? [] : branches
|
||||
end
|
||||
|
||||
def tag_suitable
|
||||
Gitea::Repository::Tags::ListService.call(@owner&.gitea_token, @owner.login, @repo.identifier)
|
||||
tags = Gitea::Repository::Tags::ListService.call(@owner&.gitea_token, @owner.login, @repo.identifier)
|
||||
tags.is_a?(Hash) && tags[:status] == -1 ? [] : tags
|
||||
end
|
||||
|
||||
def contributor_suitable
|
||||
|
|
Loading…
Reference in New Issue