删除文件

dev_static
daiao 5 years ago
parent 1b25daba45
commit a16ad63e19

@ -46,10 +46,15 @@ module GitHelper
end
# 添加目录
def add_git_folder(folder_path, author_name, author_email, message)
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)
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)
end
# 版本库Fork功能
def project_fork(container, original_rep_path, username)
raise Educoder::TipException.new("fork源路径为空,fork失败!") if original_rep_path.blank?

@ -901,12 +901,14 @@ class ShixunsController < ApplicationController
def upload_git_folder
author_name = current_user.real_name
author_email = current_user.git_mail
add_git_folder(@path, author_name, author_email, "upload folder by browser")
git_add_folder(@path, author_name, author_email, "upload folder by browser")
render_ok
end
def delete_git_file
author_name = current_user.real_name
author_email = current_user.git_mail
git_delete_file(@path, author_name, author_email, "delete filer by browser")
render_ok
end

Loading…
Cancel
Save