From 79c557bd68a69ea849694a1d7a8d09964ead5728 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Thu, 27 Aug 2020 14:43:44 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E5=9C=A8=E7=BA=BF=E5=88=9B=E5=BB=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=EF=BC=8Ccommiter=E4=BF=A1=E6=81=AF=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 ++ app/interactors/gitea/create_file_interactor.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 2e2711aa9..c968161b4 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -66,6 +66,8 @@ class RepositoriesController < ApplicationController end def create_file + content_params = content_params.merge(committer: {email: current_user.mail, name: current_user.login}) + interactor = Gitea::CreateFileInteractor.call(current_user.gitea_token, @project.owner.login, content_params) if interactor.success? @file = interactor.result diff --git a/app/interactors/gitea/create_file_interactor.rb b/app/interactors/gitea/create_file_interactor.rb index 27a381e73..278d5d857 100644 --- a/app/interactors/gitea/create_file_interactor.rb +++ b/app/interactors/gitea/create_file_interactor.rb @@ -57,6 +57,7 @@ module Gitea 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? + file_params = file_params.merge(committer: @params[:committer]) file_params end end