From a3b31ee67afb1f5adb8f5abf9c2f8a34f7262c29 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 30 Apr 2024 16:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E5=88=86=E6=94=AF=E4=B8=8D=E5=AD=98=E5=9C=A8=E4=B8=8E=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=E4=B8=BA=E7=A9=BA=E4=B8=A4=E7=A7=8D?= =?UTF-8?q?=E6=83=85=E5=86=B5=E7=9A=84=E6=96=87=E4=BB=B6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index c8e4380e0..a71c2ff1a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -64,10 +64,9 @@ class RepositoriesController < ApplicationController @entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder.repo_name) else @entries = Gitea::Repository::Entries::ListService.new(@owner, @project.identifier, ref: @ref).call + return render_not_found if @entries.is_a?(Array) && @entries.blank? @entries = @entries.present? ? @entries.sort_by{ |hash| hash['type'] } : [] @path = GiteaService.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/" - @repo_detail = $gitea_client.get_repos_by_owner_repo(@owner.login, @project.identifier) - return render_not_found if @entries.blank? && !@repo_detail["empty"] end end