[aide] task-optimize: 修复已实现:git add_all 方法排除 .lock 文件

This commit is contained in:
2025-12-18 10:11:18 +08:00
parent 9d4f6b8a22
commit f3de256fa3
2 changed files with 12 additions and 4 deletions

View File

@@ -25,8 +25,8 @@ class GitIntegration:
def add_all(self) -> None:
self.ensure_repo()
# 使用 -A 确保删除的文件也被暂存
result = self._run(["add", "-A"], check=False)
# 使用 -A 确保删除的文件也被暂存,排除 .lock 文件避免锁文件被提交
result = self._run(["add", "-A", "--", ".", ":!*.lock"], check=False)
if result.returncode != 0:
raise FlowError(_format_git_error("git add 失败", result))