Merge pull request #4830 from chr15m/add-readonly-no-git-feature

Allow adding files outside repo when git commits off.
This commit is contained in:
paul-gauthier
2026-02-14 06:17:11 -08:00
committed by GitHub

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}"
)