fix(guard): porcelain路径解析健壮化(line[2:].strip + rename格式处理)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user