git-remote-hg icon indicating copy to clipboard operation
git-remote-hg copied to clipboard

Normalize the path using replace().

Open CrossVR opened this issue 9 years ago • 2 comments

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.

CrossVR avatar Jul 30 '16 17:07 CrossVR

This solved the issue of paths being falsly detected as new for me.

BengtOFFIS avatar Nov 26 '18 15:11 BengtOFFIS

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...

IngeniousOne avatar Jul 28 '19 20:07 IngeniousOne