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

This commit is contained in:
paul-gauthier
2026-02-18 18:33:10 -08:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@@ -868,7 +868,13 @@ class Commands:
self.io.tool_error(f"{matched_file} is already in the chat as an editable file")
continue
elif abs_file_path in self.coder.abs_read_only_fnames:
if self.coder.repo and self.coder.repo.path_in_repo(matched_file):
# Determine if file can be promoted to editable
if self.coder.repo:
can_edit = self.coder.repo.path_in_repo(matched_file)
else:
can_edit = abs_file_path.startswith(self.coder.root)
if can_edit:
self.coder.abs_read_only_fnames.remove(abs_file_path)
self.coder.abs_fnames.add(abs_file_path)
self.io.tool_output(

View File

@@ -571,7 +571,8 @@ class GitRepo:
return
tracked_files = set(self.get_tracked_files())
return self.normalize_path(path) in tracked_files
normalized = self.normalize_path(path)
return normalized in tracked_files
def abs_root_path(self, path):
res = Path(self.root) / path