Allow adding files outside repo when git commits off.

This commit is contained in:
Chris McCormick
2026-02-14 20:42:06 +08:00
parent f626e44a0d
commit 172df73b85

View File

@@ -846,7 +846,11 @@ class Commands:
for matched_file in sorted(all_matched_files):
abs_file_path = self.coder.abs_root_path(matched_file)
if not abs_file_path.startswith(self.coder.root) and not is_image_file(matched_file):
if (
not abs_file_path.startswith(self.coder.root)
and not is_image_file(matched_file)
and self.coder.auto_commits
):
self.io.tool_error(
f"Can not add {abs_file_path}, which is not within {self.coder.root}"
)