summary refs log tree commit diff stats
path: root/ranger/ext/vcs
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2015-12-28 11:27:35 +0100
committernfnty <git@nfnty.se>2016-02-08 04:43:04 +0100
commit69ac2c873254f82669471254ee6b174237957738 (patch)
tree48202f2bf56de6524a9171b90c837efc50701907 /ranger/ext/vcs
parente7cde84822cf990501e2fbba60e3109829af7aa2 (diff)
downloadranger-69ac2c873254f82669471254ee6b174237957738.tar.gz
VCS: Fix browsercolumn
Diffstat (limited to 'ranger/ext/vcs')
-rw-r--r--ranger/ext/vcs/vcs.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py
index b4009d62..d70af92d 100644
--- a/ranger/ext/vcs/vcs.py
+++ b/ranger/ext/vcs/vcs.py
@@ -354,14 +354,18 @@ class Vcs(object):
 def init_subroots(dirobj):
     """Initialize roots under dirobj"""
     redraw = False
+    has_vcschild = False
+
     for fileobj in dirobj.files_all:
         if not fileobj.is_directory or not fileobj.vcs or not fileobj.vcs.track:
             continue
-        if fileobj.vcs.is_root and not fileobj.vcs.rootinit:
-            if fileobj.vcs.init_root():
-                redraw = True
+        if fileobj.vcs.is_root:
+            has_vcschild = True
+            if not fileobj.vcs.rootinit:
+                fileobj.vcs.init_root()
         elif fileobj.is_link:
             if os.path.realpath(fileobj.path) == fileobj.vcs.root:
+                has_vcschild = True
                 if not fileobj.vcs.rootvcs.rootinit:
                     fileobj.vcs.rootvcs.init_root()
                 fileobj.vcsstatus = fileobj.vcs.rootvcs.obj.vcsstatus
@@ -370,6 +374,11 @@ def init_subroots(dirobj):
                 fileobj.vcsstatus = fileobj.vcs.rootvcs.status_subpath(
                     os.path.realpath(fileobj.path))
             redraw = True
+
+    if dirobj.has_vcschild != has_vcschild:
+        redraw = True
+        dirobj.has_vcschild = has_vcschild
+
     return redraw
 
 class VcsThread(threading.Thread):