FIX update git commit api for gitea platform

This commit is contained in:
Jasder 2020-05-29 19:24:55 +08:00
parent e7c4668f63
commit c018e79b88
2 changed files with 3 additions and 4 deletions

View File

@ -49,7 +49,6 @@ class RepositoriesController < ApplicationController
def commit
@commit = Gitea::Repository::Commits::GetService.new(@repo.user.login, @repo.identifier, params[:sha], current_user.gitea_token).call
@custom_commit = Gitea::Repository::Commits::GetService.new(@repo.user.login, @repo.identifier, params[:sha], current_user.gitea_token, true).call
end
def tags

View File

@ -1,6 +1,6 @@
json.key_format! camelize: :lower
json.additions @custom_commit['TotalAddition']
json.deletions @custom_commit['TotalDeletion']
json.additions @commit['commit_diff']['TotalAddition']
json.deletions @commit['commit_diff']['TotalDeletion']
json.sha @commit['sha']
json.url request.url
json.commit do
@ -23,4 +23,4 @@ json.parents @commit['parents'] do |parent|
json.url EduSetting.get('host_name') + commit_repository_path(@repo, parent['sha'])
end
json.files @custom_commit['Files']
json.files @commit['commit_diff']['Files']