瀏覽代碼

Translate Windows path separators to slashes.

Jelmer Vernooij 7 年之前
父節點
當前提交
81b451334e
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      dulwich/ignore.py

+ 2 - 0
dulwich/ignore.py

@@ -278,6 +278,8 @@ class IgnoreFilterManager(object):
         if os.path.isabs(path):
             path = os.path.relpath(path, self._top_path)
         filters = [(0, f) for f in self._global_filters]
+        if os.path.sep != '/':
+            path = path.replace(os.path.sep, '/')
         parts = path.split('/')
         for i in range(len(parts)+1):
             dirname = '/'.join(parts[:i])