fix(guard): porcelain路径解析健壮化(line[2:].strip + rename格式处理)

This commit is contained in:
hmo
2026-07-21 01:19:53 +08:00
parent a69b246c57
commit 95d07f6a11
+6 -1
View File
@@ -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: