Parcourir la source

Be os.path.sep-independent.

Jelmer Vernooij il y a 7 ans
Parent
commit
fb41ca870a
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      dulwich/porcelain.py

+ 1 - 1
dulwich/porcelain.py

@@ -377,7 +377,7 @@ def add(repo=".", paths=None):
             paths = [paths]
         for p in paths:
             relpath = os.path.relpath(p, r.path)
-            if relpath.startswith('../'):
+            if relpath.startswith('..' + os.path.sep):
                 raise ValueError('path %r is not in repo' % relpath)
             # FIXME: Support patterns, directories.
             if ignore_manager.is_ignored(relpath):