Normalize the path using replace().
On Windows os.path.normpath() will add backslashes and quotes to the path which git can't handle.
The original commit 978314a4be4d51ceaca8bf8359b29289b16d2691 mentions that the intention for os.path.normpath() was to normalize paths with 'foo//bar'. Thus to make sure we don't get unintended consequences I suggest a manual replacement.
This solved the issue of paths being falsly detected as new for me.
Hi, everybody!
There is a better solution, to use "posixpath" in this case (only here).
`
def fix_file_path(path):
#path = os.path.normpath(path)
path = posixpath.normpath(path)
if not os.path.isabs(path):
return path
#return os.path.relpath(path, '/')
return posixpath.relpath(path, '/')
'
Something like that...