Added a test case to fail if git posix paths are not turned into windows paths

This commit is contained in:
Paul Gauthier 2023-07-05 16:53:43 -07:00
parent b3d624b7cd
commit c6696e7245
2 changed files with 20 additions and 9 deletions

View file

@ -6,7 +6,7 @@ import os
import sys
import traceback
from json.decoder import JSONDecodeError
from pathlib import Path
from pathlib import Path, PurePosixPath
import backoff
import git
@ -248,17 +248,10 @@ class Coder:
self.repo = git.Repo(repo_paths.pop(), odbt=git.GitDB)
self.root = os.path.abspath(self.repo.working_tree_dir)
if self.verbose:
dump(self.repo)
dump(self.root)
dump(os.getcwd())
new_files = []
for fname in self.abs_fnames:
relative_fname = self.get_rel_fname(fname)
if self.verbose:
dump(fname)
dump(relative_fname)
tracked_files = set(self.get_tracked_files())
if relative_fname not in tracked_files:
@ -962,6 +955,7 @@ class Coder:
def get_tracked_files(self):
# convert to appropriate os.sep, since git always normalizes to /
files = set(self.repo.git.ls_files().splitlines())
# return files
if os.sep == "/":
return files
return set(path.replace("/", os.sep) for path in files)