From f61370a82d368a38be8009fb6e1235f22391ec91 Mon Sep 17 00:00:00 2001 From: zhang hongbo Date: Wed, 25 Mar 2026 16:56:08 +0800 Subject: [PATCH] =?UTF-8?q?prod=20stable=20=E6=8B=89git=E9=92=B1=E6=B8=85?= =?UTF-8?q?=E7=90=86=E5=AD=90=E5=88=86=E6=94=AF=20=E4=BD=86=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E6=8B=89=E5=8F=96=E4=B8=BB=E9=A1=B9=E7=9B=AEsha=20=20?= =?UTF-8?q?=E9=9D=9E=E6=9C=80=E6=96=B0=E5=AD=90=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vars/Pipeline_prod.groovy | 8 ++++++++ vars/Pipeline_stable.groovy | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/vars/Pipeline_prod.groovy b/vars/Pipeline_prod.groovy index 846d287..c5d3268 100644 --- a/vars/Pipeline_prod.groovy +++ b/vars/Pipeline_prod.groovy @@ -29,6 +29,14 @@ def call(Map config) // 配置 Git 支持长路径(解决 Windows 260 字符限制) bat 'git config --global core.longpaths true' } + script { + // 最小化处理:checkout 前仅重置子模块,避免残留改动导致冲突 + bat ''' + if exist .gitmodules ( + git submodule foreach --recursive git reset --hard + ) + ''' + } checkout([ $class: 'GitSCM', branches: [[name: '*/USA']], // 分支名 diff --git a/vars/Pipeline_stable.groovy b/vars/Pipeline_stable.groovy index dc65376..bb22d7c 100644 --- a/vars/Pipeline_stable.groovy +++ b/vars/Pipeline_stable.groovy @@ -33,6 +33,14 @@ def call(Map config) // 配置 Git 支持长路径(解决 Windows 260 字符限制) bat 'git config --global core.longpaths true' } + script { + // 最小化处理:checkout 前仅重置子模块,避免残留改动导致冲突 + bat ''' + if exist .gitmodules ( + git submodule foreach --recursive git reset --hard + ) + ''' + } checkout([ $class: 'GitSCM', branches: [[name: '*/QA']], // 分支名