Browse Source

修复:区分分支不存在与文件列表为空两种情况的文件列表

pull/347/head
yystopf 2 years ago
parent
commit
a3b31ee67a
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      app/controllers/repositories_controller.rb

+ 1
- 2
app/controllers/repositories_controller.rb View File

@@ -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


Loading…
Cancel
Save