mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 05:35:46 +08:00
FIX base and head params problem for compare api
(cherry picked from commit 4c2c3d17e2)
This commit is contained in:
@@ -6,9 +6,9 @@ class CompareController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
base_ref = Addressable::URI.unescape(params[:base])
|
base = Addressable::URI.unescape(params[:base])
|
||||||
@ref = head_ref = Addressable::URI.unescape(params[:head]&.split('.json')[0])
|
head = params[:head].include?('json') ? params[:head]&.split('.json')[0] : params[:head]
|
||||||
@compare_result = Gitea::Repository::Commits::CompareService.call(@owner.login, @project.identifier, base_ref, head_ref)
|
@compare_result = Gitea::Repository::Commits::CompareService.call(@owner.login, @project.identifier, head, base)
|
||||||
|
|
||||||
# render json: @compare_result
|
# render json: @compare_result
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user