fix: move dict init into __init__

This commit is contained in:
Paul Gauthier 2024-08-06 09:34:25 -03:00
parent f64cdfa72a
commit 4e5e9b4a1a
2 changed files with 3 additions and 9 deletions

View file

@ -36,6 +36,9 @@ class GitRepo:
self.io = io self.io = io
self.models = models self.models = models
self.normalized_path = {}
self.tree_files = {}
self.attribute_author = attribute_author self.attribute_author = attribute_author
self.attribute_committer = attribute_committer self.attribute_committer = attribute_committer
self.attribute_commit_message = attribute_commit_message self.attribute_commit_message = attribute_commit_message
@ -229,8 +232,6 @@ class GitRepo:
return diffs return diffs
tree_files = {}
def get_tracked_files(self): def get_tracked_files(self):
if not self.repo: if not self.repo:
return [] return []
@ -260,8 +261,6 @@ class GitRepo:
return res return res
normalized_path = {}
def normalize_path(self, path): def normalize_path(self, path):
orig_path = path orig_path = path
res = self.normalized_path.get(orig_path) res = self.normalized_path.get(orig_path)

View file

@ -33,8 +33,6 @@ class RepoMap:
warned_files = set() warned_files = set()
tokens_per_char = None
def __init__( def __init__(
self, self,
map_tokens=1024, map_tokens=1024,
@ -87,9 +85,6 @@ class RepoMap:
if not mentioned_idents: if not mentioned_idents:
mentioned_idents = set() mentioned_idents = set()
# reset the estimate
self.tokens_per_char = None
max_map_tokens = self.max_map_tokens max_map_tokens = self.max_map_tokens
# With no files in the chat, give a bigger view of the entire repo # With no files in the chat, give a bigger view of the entire repo