diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index d8479d458..e72f1f5da 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -53,13 +53,15 @@ module GitHelper end # 添加目录 - def git_add_folder(folder_path, author_name, author_email, message) - GitService.add_tree(file_path: folder_path, message: message, author_name: author_name, author_email: author_email) + def git_add_folder(repo_path, folder_path, author_name, author_email, message) + GitService.add_tree(repo_path: repo_path, file_path: folder_path, message: message, author_name: author_name, + author_email: author_email) end # 删除文件 - def git_delete_file(file_path, author_name, author_email, message) - GitService.delete_file(file_path: file_path, message: message, author_name: author_name, author_email: author_email) + def git_delete_file(repo_path, file_path, author_name, author_email, message) + GitService.delete_file(repo_path, repo_path, file_path: file_path, message: message, author_name: author_name, + author_email: author_email) end # 版本库Fork功能 diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index d06ce12bf..fb8fdeb2f 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -906,7 +906,7 @@ class ShixunsController < ApplicationController author_name = current_user.real_name author_email = current_user.git_mail message = params[:message] || "upload folder by browser" - git_add_folder(@path, author_name, author_email, message) + git_add_folder(@repo_path, @path, author_name, author_email, message) render_ok end @@ -914,7 +914,7 @@ class ShixunsController < ApplicationController author_name = current_user.real_name author_email = current_user.git_mail message = params[:message] || "delete file by browser" - git_delete_file(@path, author_name, author_email, message) + git_delete_file(@repo_path, @path, author_name, author_email, message) render_ok end