修改主版本库丢失的404问题

This commit is contained in:
huang 2015-07-22 16:38:52 +08:00
parent 86fb9710ef
commit 4b923c540d
1 changed files with 12 additions and 1 deletions

View File

@ -484,7 +484,18 @@ update
if params[:repository_id].present?
@repository = @project.repositories.find_by_identifier_param(params[:repository_id])
else
@repository = @project.repository
# 多版本库,如果一个版本库为空则去下一个
rep_count = @project.repositories.count
if @project.repository.nil?
for i in 0..rep_count
unless @project.repositories[i].nil?
@repository = @project.repositories[i]
break
end
end
else
@repository = @project.repository
end
end
(render_404; return false) unless @repository
@path = params[:path].is_a?(Array) ? params[:path].join('/') : params[:path].to_s