From f6be81f599c87caca735231872443fc450ad304b Mon Sep 17 00:00:00 2001 From: nfnty Date: Wed, 10 Feb 2016 02:43:35 +0100 Subject: VCS: Fix has_vcschild directory load --- ranger/container/directory.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ranger/container/directory.py b/ranger/container/directory.py index fdaf1ee8..8ace0d85 100644 --- a/ranger/container/directory.py +++ b/ranger/container/directory.py @@ -306,6 +306,7 @@ class Directory(FileSystemObject, Accumulator, Loadable): files = [] disk_usage = 0 + has_vcschild = False for name in filenames: try: file_lstat = os_lstat(name) @@ -332,9 +333,12 @@ class Directory(FileSystemObject, Accumulator, Loadable): else: item.relative_path = item.basename item.relative_path_lower = item.relative_path.lower() - if item.vcs and item.vcs.track and not item.vcs.is_root_pointer: - item.vcsstatus = item.vcs.rootvcs.status_subpath( - os.path.join(self.realpath, item.basename), is_directory=True) + if item.vcs and item.vcs.track: + if item.vcs.is_root_pointer: + has_vcschild = True + else: + item.vcsstatus = item.vcs.rootvcs.status_subpath( + os.path.join(self.realpath, item.basename), is_directory=True) else: item = File(name, preload=stats, path_is_abs=True, basename_is_rel_to=basename_is_rel_to) @@ -347,6 +351,7 @@ class Directory(FileSystemObject, Accumulator, Loadable): files.append(item) self.percent = 100 * len(files) // len(filenames) yield + self.has_vcschild = has_vcschild self.disk_usage = disk_usage self.filenames = filenames -- cgit 1.4.1-2-gfad0