From fa6b25a22d8ca8be76c820677c66d5421c3863f1 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Mon, 16 Nov 2020 16:03:41 +0800 Subject: [PATCH] FIX render commit bug for sub entries api --- app/views/repositories/_simple_entry.json.jbuilder | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/repositories/_simple_entry.json.jbuilder b/app/views/repositories/_simple_entry.json.jbuilder index 91b0e6301..ab9910dd1 100644 --- a/app/views/repositories/_simple_entry.json.jbuilder +++ b/app/views/repositories/_simple_entry.json.jbuilder @@ -15,7 +15,11 @@ if @project.forge? json.image_type image_type json.is_readme_file is_readme_type?(file_name) if entry['latest_commit'] - json.partial! 'last_commit', entry: entry + if entry['type'] != 'file' + json.partial! 'last_commit', entry: entry + else + json.commit nil + end end end