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: