From ba93347df8d77ced49de872ace980e34fc38f885 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Fri, 5 Jun 2020 10:07:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 18 ------------------ .../gitea/create_file_interactor.rb | 2 +- dump.rdb | Bin 771118 -> 771119 bytes 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 78361f71f..6d0867a0c 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -92,24 +92,6 @@ class RepositoriesController < ApplicationController 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 hook_type = request.headers["X-Gitea-Event"].to_s # 获取推送的方式 ownername = @project.owner.try(:login) diff --git a/app/interactors/gitea/create_file_interactor.rb b/app/interactors/gitea/create_file_interactor.rb index 6e3a6ca0f..18e105f31 100644 --- a/app/interactors/gitea/create_file_interactor.rb +++ b/app/interactors/gitea/create_file_interactor.rb @@ -53,7 +53,7 @@ module Gitea def 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(content: Base64.encode64(@params[:content])) file_params = file_params.merge(message: @params[:message]) unless @params[:message].blank? diff --git a/dump.rdb b/dump.rdb index 4b391e94e82bb8bfc6c7d52bed5f313bad99bfa0..3922ec36fbfff135895bc9e31aea099623aaaddb 100644 GIT binary patch delta 141 zcmZ42p})REe}aL~{pB~~esPo*r>5xUrsf{nu-R&&(*_pZp0ySe&&y2~VT@t!n`JS% zn9)&4(9qP<(Adbx)WTfP(89>j)V%p9WBXA?5M}~mW*}w(Vpbq#17da{<^W<&Am-YB el#$!^5ZK(wvW(KarU&OU{%7=(lD=PgYCZsc`!X2- delta 140 zcmZ4Ap}(#}e}aL~re!zdesPo*r>5xUrsf_B$T6Piw1Gwb`wEMR=jA4gFvc*~vzkmU zW^@!3Ff_F^G&V9avM|%LFt;={YCgu;evA=>nShuXh*^M`6^Pk@m>q~YfS41Axwao; dWsqcpGS!TF5;tIo{6Ug_v42>|P&F|7aq