FIX update git commit api for gitea platform
This commit is contained in:
parent
e7c4668f63
commit
c018e79b88
|
@ -49,7 +49,6 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
def commit
|
def commit
|
||||||
@commit = Gitea::Repository::Commits::GetService.new(@repo.user.login, @repo.identifier, params[:sha], current_user.gitea_token).call
|
@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
|
end
|
||||||
|
|
||||||
def tags
|
def tags
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
json.key_format! camelize: :lower
|
json.key_format! camelize: :lower
|
||||||
json.additions @custom_commit['TotalAddition']
|
json.additions @commit['commit_diff']['TotalAddition']
|
||||||
json.deletions @custom_commit['TotalDeletion']
|
json.deletions @commit['commit_diff']['TotalDeletion']
|
||||||
json.sha @commit['sha']
|
json.sha @commit['sha']
|
||||||
json.url request.url
|
json.url request.url
|
||||||
json.commit do
|
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'])
|
json.url EduSetting.get('host_name') + commit_repository_path(@repo, parent['sha'])
|
||||||
end
|
end
|
||||||
|
|
||||||
json.files @custom_commit['Files']
|
json.files @commit['commit_diff']['Files']
|
||||||
|
|
Loading…
Reference in New Issue