From fabd7b3c6f3899abfb4fcc3ac810afdd5d2dd4a0 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Fri, 5 Jun 2020 18:02:21 +0800 Subject: [PATCH] FIX rend README.md file --- app/views/repositories/entries.json.jbuilder | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/repositories/entries.json.jbuilder b/app/views/repositories/entries.json.jbuilder index 6017ab226..fcd6f7be4 100644 --- a/app/views/repositories/entries.json.jbuilder +++ b/app/views/repositories/entries.json.jbuilder @@ -14,7 +14,14 @@ json.entries do json.sha entry['sha'] json.type entry['type'] json.size entry['size'] - json.content entry['content'] + content = + if entry['name'] === 'README.md' + content = Gitea::Repository::Entries::GetService.call(@project_owner, @project.identifier, entry['name'], ref: @ref)['content'] + render_decode64_content content + else + entry['content'] + end + json.content content json.target entry['target'] if entry['latest_commit'] json.partial! 'last_commit', entry: entry