fix logic when there is no git repo

This commit is contained in:
Paul Gauthier 2023-05-11 06:01:37 -07:00
parent 86ba5c778c
commit a614179209
2 changed files with 11 additions and 7 deletions

View file

@ -79,6 +79,14 @@ class Coder:
repo_paths.append(repo_path)
except git.exc.InvalidGitRepositoryError:
pass
if fname.is_dir():
continue
self.console.print(f"[bright_black]Loading {fname}")
fname = fname.resolve()
self.abs_fnames.add(str(fname))
num_repos = len(set(repo_paths))
if num_repos == 0:
@ -95,10 +103,6 @@ class Coder:
new_files = []
for fname in abs_fnames:
if fname.is_dir():
continue
self.console.print(f"[bright_black]Loading {fname}")
fname = fname.resolve()
self.abs_fnames.add(str(fname))