From 95d07f6a110e7b7867bf85a5d2c276b2e1fd09b0 Mon Sep 17 00:00:00 2001 From: hmo Date: Tue, 21 Jul 2026 01:19:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(guard):=20porcelain=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=81=A5=E5=A3=AE=E5=8C=96(line[2:].strip=20?= =?UTF-8?q?+=20rename=E6=A0=BC=E5=BC=8F=E5=A4=84=E7=90=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/deploy_guard.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy/profile-scripts/deploy_guard.py b/deploy/profile-scripts/deploy_guard.py index 9945e8b5..a41d610c 100644 --- a/deploy/profile-scripts/deploy_guard.py +++ b/deploy/profile-scripts/deploy_guard.py @@ -77,7 +77,12 @@ def check_code_drift(): return modified, untracked = [], [] for line in out.splitlines(): - status, path = line[:2], line[3:].strip() + if not line.strip(): + continue + status, path = line[:2], line[2:].strip() + # 重命名格式 "R old -> new" 取新路径 + if " -> " in path: + path = path.split(" -> ", 1)[1] if status == "??": untracked.append(path) else: