diff options
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/git/util.py b/git/util.py index c29ed70b..fecd9fa2 100644 --- a/git/util.py +++ b/git/util.py @@ -19,7 +19,7 @@ from exc import GitCommandError # Most of these are unused here, but are for use by git-python modules so these # don't see gitdb all the time. Flake of course doesn't like it. -from gitdb.util import ( +from gitdb.util import ( # NOQA make_sha, LockedFD, file_contents_ro, @@ -84,14 +84,13 @@ def join_path(a, *p): return path -def to_native_path_windows(path): - return path.replace('/', '\\') - +if sys.platform.startswith('win'): + def to_native_path_windows(path): + return path.replace('/', '\\') -def to_native_path_linux(path): - return path.replace('\\', '/') + def to_native_path_linux(path): + return path.replace('\\', '/') -if sys.platform.startswith('win'): to_native_path = to_native_path_windows else: # no need for any work on linux |