From 91966192e1de191673356beb3a4ef0e3e9f5075a Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Wed, 9 Sep 2020 10:33:49 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E5=A4=84=E7=90=86gitea=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E4=B8=AD=E8=8E=B7=E5=8F=96=E5=AD=90=E7=9B=AE=E5=BD=95?= =?UTF-8?q?404=E6=97=B6=E7=9A=84=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 9d1c98e37..3776cade4 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -40,8 +40,10 @@ class RepositoriesController < ApplicationController 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) if interactor.success? - @sub_entries = interactor.result - @sub_entries = [] << @sub_entries unless @sub_entries.is_a? Array + result = interactor.result + return @sub_entries = [] if result[:status] == -1 + + @sub_entries = [] << result unless result.is_a? Array @sub_entries = @sub_entries.sort_by{ |hash| hash['type'] } else render_error(interactor.error)