修复:区分分支不存在与文件列表为空两种情况的文件列表
This commit is contained in:
		
							parent
							
								
									b236733637
								
							
						
					
					
						commit
						a3b31ee67a
					
				| 
						 | 
					@ -64,10 +64,9 @@ class RepositoriesController < ApplicationController
 | 
				
			||||||
      @entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder.repo_name)
 | 
					      @entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder.repo_name)
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      @entries = Gitea::Repository::Entries::ListService.new(@owner, @project.identifier, ref: @ref).call
 | 
					      @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'] } : []
 | 
					      @entries = @entries.present? ? @entries.sort_by{ |hash| hash['type'] } : []
 | 
				
			||||||
      @path = GiteaService.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
 | 
					      @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
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue