Skip to content

Commit 4fe6f71

Browse files
authored
Merge pull request #97 from eliadh/develop
Add support for windows paths
2 parents 69aa30b + b7adba9 commit 4fe6f71

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backslash/contrib/slash_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def _calculate_file_hash(self, filename):
398398
def _get_git_repo(self, dirname):
399399
if not os.path.isabs(dirname):
400400
dirname = os.path.abspath(os.path.join(_PWD, dirname))
401-
while dirname != '/':
401+
while dirname != os.path.normpath(os.path.abspath(os.path.sep)):
402402
if os.path.isdir(os.path.join(dirname, '.git')):
403403
return git.Repo(dirname)
404404
dirname = os.path.normpath(os.path.abspath(os.path.join(dirname, '..')))

backslash/contrib/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def normalize_file_path(path):
3636
if not os.path.isabs(path):
3737
path = os.path.abspath(os.path.join(_HERE, path))
3838
dirname = os.path.normpath(path)
39-
while dirname != '/':
39+
while dirname != os.path.normpath(os.path.abspath(os.path.sep)):
4040
for special_dir in _SPECIAL_DIRS:
4141
if os.path.isdir(os.path.join(dirname, special_dir)):
4242
return os.path.normpath(os.path.relpath(path, dirname))

0 commit comments

Comments
 (0)