mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
Fix issue with path normalization that was causing files to be marked dirty on Windows when they were not
This commit is contained in:
parent
00d5348ee6
commit
ba87510db1
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