Explorar o código

Merge pull request #19 from foosel/fix/18

Fix file_exists helper under Windows
Jan Holthuis %!s(int64=4) %!d(string=hai) anos
pai
achega
30415b0fcf
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      sphinx_multiversion/git.py

+ 5 - 0
sphinx_multiversion/git.py

@@ -2,6 +2,7 @@
 import collections
 import datetime
 import logging
+import os
 import re
 import subprocess
 import tarfile
@@ -119,6 +120,10 @@ def get_refs(
 
 
 def file_exists(gitroot, refname, filename):
+    if os.sep != "/":
+        # Git requires / path sep, make sure we use that
+        filename = filename.replace(os.sep, "/")
+
     cmd = (
         "git",
         "cat-file",