|
|
|
@ -97,6 +97,7 @@ class PullRequestsController < ApplicationController
|
|
|
|
|
target_project_id = params[:target_project_id]
|
|
|
|
|
begin
|
|
|
|
|
# 如果分支有改动
|
|
|
|
|
Rails.logger.info("=====compare_pull_request============ #{compare_pull_request(source_branch, target_project_id, target_branch)}")
|
|
|
|
|
if compare_pull_request(source_branch, target_project_id, target_branch)
|
|
|
|
|
# 如果传送了目标项目ID即向fork源项目发送请求
|
|
|
|
|
# if params[:forked_project_id] && params[:source_project] == "forked_project_name"
|
|
|
|
@ -161,6 +162,13 @@ class PullRequestsController < ApplicationController
|
|
|
|
|
git_sourse_commit_id = @g.commits(@project.gpid, :ref_name => source_branch).first.try(:id)
|
|
|
|
|
git_target_commit_id = @g.commits(@project.gpid, :ref_name => target_branch).first.try(:id)
|
|
|
|
|
end
|
|
|
|
|
Rails.logger.info("==========git_sourse_commit_id======#{git_sourse_commit_id}")
|
|
|
|
|
Rails.logger.info("==========git_target_commit_id======#{git_target_commit_id}")
|
|
|
|
|
Rails.logger.info("==========git_sourse_commit_id_to_s======#{git_sourse_commit_id.to_s}")
|
|
|
|
|
Rails.logger.info("==========git_target_commit_id_to_s======#{git_target_commit_id.to_s}")
|
|
|
|
|
Rails.logger.info("==========is_equal======#{ git_sourse_commit_id.to_s == git_target_commit_id.to_s}")
|
|
|
|
|
# status = (git_sourse_commit_id == git_target_commit_id ? false : true)
|
|
|
|
|
# Rails.logger.info("==========status======#{status}")
|
|
|
|
|
git_sourse_commit_id.to_s == git_target_commit_id.to_s
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|