mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 13:45:44 +08:00
FIX 处理gitea版本库中获取子目录404时的容错
This commit is contained in:
@@ -40,8 +40,10 @@ class RepositoriesController < ApplicationController
|
|||||||
file_path_uri = URI.parse(URI.encode(params[:filepath].to_s.strip))
|
file_path_uri = URI.parse(URI.encode(params[:filepath].to_s.strip))
|
||||||
interactor = Repositories::EntriesInteractor.call(@project.owner, @project.identifier, file_path_uri, ref: @ref)
|
interactor = Repositories::EntriesInteractor.call(@project.owner, @project.identifier, file_path_uri, ref: @ref)
|
||||||
if interactor.success?
|
if interactor.success?
|
||||||
@sub_entries = interactor.result
|
result = interactor.result
|
||||||
@sub_entries = [] << @sub_entries unless @sub_entries.is_a? Array
|
return @sub_entries = [] if result[:status] == -1
|
||||||
|
|
||||||
|
@sub_entries = [] << result unless result.is_a? Array
|
||||||
@sub_entries = @sub_entries.sort_by{ |hash| hash['type'] }
|
@sub_entries = @sub_entries.sort_by{ |hash| hash['type'] }
|
||||||
else
|
else
|
||||||
render_error(interactor.error)
|
render_error(interactor.error)
|
||||||
|
|||||||
Reference in New Issue
Block a user