add debug

This commit is contained in:
Nigel 2019-09-23 16:32:36 +08:00
parent d940d5eb1d
commit 32f3980544
1 changed files with 8 additions and 8 deletions

View File

@ -126,30 +126,30 @@ module Mobile
end
modificationLines = 0
Rails.logger.info "111111111111111111111111111111111111111111111111111111"
params[:shaList].each do |sha|
# Rails.logger.info project.gpid
Rails.logger.info project.gpid
commit = g.commit(project.gpid, sha)
if commit
if branch_sha_array.include?(commit.id)
# result << commit
result << true
else
# Rails.logger.info "当前的commit不属于这个分支"
Rails.logger.info "当前的commit不属于这个分支"
result << false # 表示当前的commit不属于这个分支
end
else
result << false
end
Rails.logger.info "222222222222222222222222222222222222222222222"
# add by qiubing
commit_diff = g.commit_diff(project.gpid, sha)
# Rails.logger.info("qiubingqiubing")
Rails.logger.info("111111111111111111qiubingqiubing1111111111111111111111111")
(0...commit_diff.length).each do |i|
tempDiff = commit_diff[i]
tempDiffArry = tempDiff.diff.split("\n")
(2...tempDiffArry.length).each do |j|
# Rails.logger.info tempDiffArry[j]
Rails.logger.info tempDiffArry[j]
if tempDiffArry[j][0] == "+" or tempDiffArry[j][0] == "-"
modificationLines += 1
end
@ -160,10 +160,10 @@ module Mobile
# {status:0, result:result}
{status:0, result:result, modificationLines:modificationLines}
else
{status:1, message: '该项目不存在或已被删除' }
{status:1, message: 'the project did\'t exist or has been deleted' }
end
else
{status:1, message: '该项目不存在或已被删除' }
{status:1, message: 'the project did\'t exist or has been deleted' }
end
end