|
|
|
@ -9,11 +9,10 @@ module GitHelper
|
|
|
|
|
# 版本库文件内容,带转码
|
|
|
|
|
def git_fle_content(repo_path, path)
|
|
|
|
|
begin
|
|
|
|
|
logger.info("##########repo_path: #{repo_path}")
|
|
|
|
|
logger.info("##########path: #{path}")
|
|
|
|
|
logger.info("git file content: repo_path is #{repo_path}, path is #{path}")
|
|
|
|
|
content = GitService.file_content(repo_path: repo_path, path: path)
|
|
|
|
|
|
|
|
|
|
logger.info("@@@@@@@@@@@@@@@@@@#{content}")
|
|
|
|
|
logger.info("git file content: content is #{content}")
|
|
|
|
|
decode_content = nil
|
|
|
|
|
if content.present?
|
|
|
|
|
content = content["content"] #6.24 -hs 这个为新增,因为当实训题里含有选择题时,这里会报错,undefined method `[]' for nil:NilClass
|
|
|
|
@ -34,7 +33,6 @@ module GitHelper
|
|
|
|
|
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
Rails.logger.error(e.message)
|
|
|
|
|
# uid_logger_error(e.message)
|
|
|
|
|
raise Educoder::TipException.new("文档内容获取异常")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|