From 3698638e985093932d458248116dc90abfc167d2 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Sun, 6 Jan 2019 15:22:09 +0100 Subject: [PATCH] Always pass forward slash to git Fixes mnauw/git-remote-hg#22 --- git-remote-hg | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/git-remote-hg b/git-remote-hg index 9bc3eda..3f53180 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -285,10 +285,16 @@ class Parser: return (user, int(date), -tz) def fix_file_path(path): + def posix_path(path): + if os.sep == '/': + return path + # even Git for Windows expects forward + return path.replace(os.sep, '/') + # also converts forward slash to backwards slash on Win path = os.path.normpath(path) if not os.path.isabs(path): - return path - return os.path.relpath(path, '/') + return posix_path(path) + return posix_path(os.path.relpath(path, '/')) def export_files(files): final = []