diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/GitSourceSettings.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/GitSourceSettings.kt index 30193efc..0c13f6d8 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/GitSourceSettings.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/GitSourceSettings.kt @@ -225,7 +225,11 @@ data class GitSourceSettings( /** * 是否设置安全目录 */ - val setSafeDirectory: Boolean? = true + val setSafeDirectory: Boolean? = true, + /** + * 是否为源材料主仓库 + */ + val mainRepo: Boolean? = false ) { val sourceRepoUrlEqualsRepoUrl: Boolean get() = GitUtil.isSameRepository( diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/api/PipelineBuildMaterial.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/api/PipelineBuildMaterial.kt index f3b1897f..d8267d05 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/api/PipelineBuildMaterial.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/api/PipelineBuildMaterial.kt @@ -39,5 +39,6 @@ data class PipelineBuildMaterial( val newCommitId: String?, val newCommitComment: String?, val commitTimes: Int?, - val scmType: ScmType? + val scmType: ScmType?, + val mainRepo: Boolean? = false ) diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/CheckoutAtomParamInput.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/CheckoutAtomParamInput.kt index 7d7d3abe..94569135 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/CheckoutAtomParamInput.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/CheckoutAtomParamInput.kt @@ -144,5 +144,9 @@ data class CheckoutAtomParamInput( /** * 是否设置安全目录 */ - val setSafeDirectory: Boolean? = true + val setSafeDirectory: Boolean? = true, + /** + * 是否为源材料主仓库 + */ + val mainRepo: Boolean? = false ) diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/GitCodeAtomParamInput.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/GitCodeAtomParamInput.kt index c37ea66e..d475813e 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/GitCodeAtomParamInput.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/GitCodeAtomParamInput.kt @@ -127,5 +127,9 @@ data class GitCodeAtomParamInput( /** * 是否设置安全目录 */ - val setSafeDirectory: Boolean? = true + val setSafeDirectory: Boolean? = true, + /** + * 是否为源材料主仓库 + */ + val mainRepo: Boolean? = false ) diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/GitCodeCommandAtomParamInput.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/GitCodeCommandAtomParamInput.kt index 3f103de6..77a7178d 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/GitCodeCommandAtomParamInput.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/pojo/input/GitCodeCommandAtomParamInput.kt @@ -138,5 +138,9 @@ data class GitCodeCommandAtomParamInput( /** * 是否设置安全目录 */ - val setSafeDirectory: Boolean? = true + val setSafeDirectory: Boolean? = true, + /** + * 是否为源材料主仓库 + */ + val mainRepo: Boolean? = false ) diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/helper/GitLogHelper.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/helper/GitLogHelper.kt index 5de51b21..dcd72286 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/helper/GitLogHelper.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/helper/GitLogHelper.kt @@ -245,7 +245,8 @@ class GitLogHelper( newCommitId = commitMaterial.newCommitId ?: commitMaterial.lastCommitId, newCommitComment = commitMaterial.newCommitComment, commitTimes = commitMaterial.commitTimes, - scmType = commitMaterial.scmType + scmType = commitMaterial.scmType, + mainRepo = settings.mainRepo ) ) ) diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/CheckoutAtomParamInputAdapter.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/CheckoutAtomParamInputAdapter.kt index 78f0b902..42585b84 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/CheckoutAtomParamInputAdapter.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/CheckoutAtomParamInputAdapter.kt @@ -124,7 +124,8 @@ class CheckoutAtomParamInputAdapter( enableTGitCache = enableTGitCache, tGitCacheUrl = tGitCacheUrl, tGitCacheProxyUrl = tGitCacheProxyUrl, - setSafeDirectory = setSafeDirectory + setSafeDirectory = setSafeDirectory, + mainRepo = mainRepo ) ).getInputs() @@ -189,7 +190,8 @@ class CheckoutAtomParamInputAdapter( enableTGitCache = enableTGitCache, tGitCacheUrl = tGitCacheUrl, tGitCacheProxyUrl = tGitCacheProxyUrl, - setSafeDirectory = setSafeDirectory + setSafeDirectory = setSafeDirectory, + mainRepo = mainRepo ) ).getInputs() diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/GitCodeAtomParamInputAdapter.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/GitCodeAtomParamInputAdapter.kt index fb117f02..c5ce3104 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/GitCodeAtomParamInputAdapter.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/GitCodeAtomParamInputAdapter.kt @@ -278,7 +278,8 @@ class GitCodeAtomParamInputAdapter( enableTGitCache = enableTGitCache, tGitCacheUrl = tGitCacheUrl, tGitCacheProxyUrl = tGitCacheProxyUrl, - setSafeDirectory = setSafeDirectory + setSafeDirectory = setSafeDirectory, + mainRepo = mainRepo ) } } diff --git a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/GitCodeCommandAtomParamInputAdapter.kt b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/GitCodeCommandAtomParamInputAdapter.kt index 8b75b995..c7b20a5a 100644 --- a/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/GitCodeCommandAtomParamInputAdapter.kt +++ b/git-checkout-core/src/main/kotlin/com/tencent/bk/devops/git/core/service/input/GitCodeCommandAtomParamInputAdapter.kt @@ -191,7 +191,8 @@ class GitCodeCommandAtomParamInputAdapter( enableTGitCache = enableTGitCache, tGitCacheUrl = tGitCacheUrl, tGitCacheProxyUrl = tGitCacheProxyUrl, - setSafeDirectory = setSafeDirectory + setSafeDirectory = setSafeDirectory, + mainRepo = mainRepo ) } }