From e7e867685eaebb0d12e9e69b74b18cb565b84f10 Mon Sep 17 00:00:00 2001 From: nfnty Date: Sun, 4 Oct 2015 22:12:21 +0200 Subject: VCS: Fix _path_contains --- ranger/ext/vcs/vcs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py index 3f7236f5..c37bf006 100644 --- a/ranger/ext/vcs/vcs.py +++ b/ranger/ext/vcs/vcs.py @@ -84,7 +84,7 @@ class Vcs(object): def _path_contains(self, parent, path): """Checks wether path is an object belonging to the subtree in parent""" if parent == path: return True - parent = os.path.normpath(parent + '/') + parent = os.path.normpath(parent) + '/' path = os.path.normpath(path) return os.path.commonprefix([parent, path]) == parent @@ -237,7 +237,6 @@ class Vcs(object): prel, tail = os.path.split(prel) # check if prel is a directory that contains some file in status - prel = os.path.relpath(path, self.root) if os.path.isdir(path): sts = set(st for p, st in self.status.items() if self._path_contains(path, os.path.join(self.root, p))) -- cgit 1.4.1-2-gfad0