Skip to content

Commit

Permalink
bug: 修复代码库开启PAC时,git_project_id字段为空 TencentBlueKing#11167
Browse files Browse the repository at this point in the history
  • Loading branch information
mingshewhe committed Oct 31, 2024
1 parent 1932e07 commit 7676cf8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class CodeGitRepositoryService @Autowired constructor(
).url
var gitProjectId: Long? = null
// 需要更新gitProjectId
if (sourceUrl != repository.url) {
if (sourceUrl != repository.url || repository.gitProjectId == null || repository.gitProjectId == 0L) {
logger.info(
"repository url unMatch,need change gitProjectId,sourceUrl=[$sourceUrl] targetUrl=[${repository.url}]"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class CodeGithubRepositoryService @Autowired constructor(
repositoryId = repositoryId
).url
var gitProjectId: Long? = null
if (sourceUrl != repository.url) {
if (sourceUrl != repository.url || repository.gitProjectId == null || repository.gitProjectId == 0L) {
logger.info(
"repository url unMatch,need change gitProjectId,sourceUrl=[$sourceUrl] " +
"targetUrl=[${repository.url}]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class CodeGitlabRepositoryService @Autowired constructor(
val repositoryId = HashUtil.decodeOtherIdToLong(repositoryHashId)
var gitProjectId: Long? = null
// 需要更新gitProjectId
if (record.url != repository.url) {
if (record.url != repository.url || repository.gitProjectId == null || repository.gitProjectId == 0L) {
logger.info(
"repository url unMatch,need change gitProjectId,sourceUrl=[${record.url}] " +
"targetUrl=[${repository.url}]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class CodeTGitRepositoryService @Autowired constructor(
val repositoryId = HashUtil.decodeOtherIdToLong(repositoryHashId)
var gitProjectId: Long? = null
// 需要更新gitProjectId
if (record.url != repository.url) {
if (record.url != repository.url || repository.gitProjectId == null || repository.gitProjectId == 0L) {
logger.info(
"repository url unMatch,need change gitProjectId,sourceUrl=[${record.url}] " +
"targetUrl=[${repository.url}]"
Expand Down

0 comments on commit 7676cf8

Please sign in to comment.