Explorar el Código

[BUGFIX] Borg commands accept absolute pathes, #4029

Strip leading path separator before trying to match a path.
Thalian hace 5 años
padre
commit
ece47ee9e4
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/borg/patterns.py

+ 1 - 1
src/borg/patterns.py

@@ -143,7 +143,7 @@ class PatternMatcher:
         in self.fallback is returned (defaults to None).
 
         """
-        path = normalize_path(path)
+        path = normalize_path(path).lstrip(os.path.sep)
         # do a fast lookup for full path matches (note: we do not count such matches):
         non_existent = object()
         value = self._path_full_patterns.get(path, non_existent)