only check tracked files if there is a repo

This commit is contained in:
Paul Gauthier 2023-08-17 10:44:33 -07:00
parent 6c2923ff70
commit fef5a7b917

View file

@ -739,8 +739,9 @@ class Coder:
def allowed_to_edit(self, path):
full_path = self.abs_root_path(path)
tracked_files = set(self.repo.get_tracked_files())
is_in_repo = path in tracked_files
if self.repo:
tracked_files = set(self.repo.get_tracked_files())
is_in_repo = path in tracked_files
if full_path in self.abs_fnames:
if self.check_for_dirty_commit(path):