修改bug
This commit is contained in:
parent
497962fc97
commit
ba93347df8
|
@ -92,24 +92,6 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def upload_file
|
|
||||||
file_ids = params[:attachment_ids]
|
|
||||||
if file_ids.present?
|
|
||||||
file_ids.each do |id|
|
|
||||||
attachment = Attachment.select(:id, :filename, :disk_directory, :disk_filename).find_by(id)
|
|
||||||
file_path = attachemnt&.diskfile.to_s
|
|
||||||
unless File.exists?(file_path)
|
|
||||||
file_content = File.open(file_path)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
render_error("请上传文件")
|
|
||||||
end
|
|
||||||
|
|
||||||
files.each do
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
def repo_hook
|
def repo_hook
|
||||||
hook_type = request.headers["X-Gitea-Event"].to_s # 获取推送的方式
|
hook_type = request.headers["X-Gitea-Event"].to_s # 获取推送的方式
|
||||||
ownername = @project.owner.try(:login)
|
ownername = @project.owner.try(:login)
|
||||||
|
|
|
@ -53,7 +53,7 @@ module Gitea
|
||||||
|
|
||||||
def file_params
|
def file_params
|
||||||
file_params = {}
|
file_params = {}
|
||||||
file_params = file_params.merge(branch: @params[:branch]) unless @params[:branch].blank? || @params[:new_branch].present?
|
file_params = file_params.merge(branch: @params[:branch]) unless (@params[:branch].blank? || @params[:new_branch].present?)
|
||||||
file_params = file_params.merge(new_branch: @params[:new_branch]) unless @params[:new_branch].blank?
|
file_params = file_params.merge(new_branch: @params[:new_branch]) unless @params[:new_branch].blank?
|
||||||
file_params = file_params.merge(content: Base64.encode64(@params[:content]))
|
file_params = file_params.merge(content: Base64.encode64(@params[:content]))
|
||||||
file_params = file_params.merge(message: @params[:message]) unless @params[:message].blank?
|
file_params = file_params.merge(message: @params[:message]) unless @params[:message].blank?
|
||||||
|
|
Loading…
Reference in New Issue