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