Browse Source

FIX sha value bug

tags/v1.0.0
Jasder 5 years ago
parent
commit
939f33a8a2
2 changed files with 4 additions and 3 deletions
  1. +3
    -2
      app/controllers/repositories_controller.rb
  2. +1
    -1
      app/views/repositories/commit.json.jbuilder

+ 3
- 2
app/controllers/repositories_controller.rb View File

@@ -82,8 +82,9 @@ class RepositoriesController < ApplicationController
end
def commit
@commit = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, params[:sha], current_user.gitea_token)
@commit_diff = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, params[:sha], current_user.gitea_token, {diff: true})
@sha = params[:sha]
@commit = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user.gitea_token)
@commit_diff = Gitea::Repository::Commits::GetService.call(@owner.login, @repository.identifier, @sha, current_user.gitea_token, {diff: true})
end
def tags


+ 1
- 1
app/views/repositories/commit.json.jbuilder View File

@@ -2,7 +2,7 @@
json.files_count @commit_diff['NumFiles']
json.total_addition @commit_diff['TotalAddition']
json.total_deletion @commit_diff['TotalDeletion']
json.files @commit_diff['Files'], partial: 'pull_requests/diff_file', as: :file, locals: {sha: ""}
json.files @commit_diff['Files'], partial: 'pull_requests/diff_file', as: :file, locals: {sha: @sha}

json.partial! 'commit', commit: @commit, project: @project
json.parents @commit['parents'] do |parent|


Loading…
Cancel
Save