mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
Merge pull request #420 from ctoth/fix-windows-paths
This commit is contained in:
commit
9023d1bc02
1 changed files with 5 additions and 2 deletions
|
@ -195,12 +195,15 @@ class GitRepo:
|
||||||
|
|
||||||
# convert to appropriate os.sep, since git always normalizes to /
|
# convert to appropriate os.sep, since git always normalizes to /
|
||||||
res = set(
|
res = set(
|
||||||
str(Path(PurePosixPath((Path(self.root) / path).relative_to(self.root))))
|
self.normalize_path(path)
|
||||||
for path in files
|
for path in files
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.filter_ignored_files(res)
|
return self.filter_ignored_files(res)
|
||||||
|
|
||||||
|
def normalize_path(self, path):
|
||||||
|
return str(Path(PurePosixPath((Path(self.root) / path).relative_to(self.root))))
|
||||||
|
|
||||||
def filter_ignored_files(self, fnames):
|
def filter_ignored_files(self, fnames):
|
||||||
if not self.aider_ignore_file or not self.aider_ignore_file.is_file():
|
if not self.aider_ignore_file or not self.aider_ignore_file.is_file():
|
||||||
return fnames
|
return fnames
|
||||||
|
@ -221,7 +224,7 @@ class GitRepo:
|
||||||
return
|
return
|
||||||
|
|
||||||
tracked_files = set(self.get_tracked_files())
|
tracked_files = set(self.get_tracked_files())
|
||||||
return path in tracked_files
|
return self.normalize_path(path) in tracked_files
|
||||||
|
|
||||||
def abs_root_path(self, path):
|
def abs_root_path(self, path):
|
||||||
res = Path(self.root) / path
|
res = Path(self.root) / path
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue