summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/fsobject/directory.py4
-rw-r--r--ranger/fsobject/fsobject.py12
2 files changed, 8 insertions, 8 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 3e5e4f84..c7c5150f 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -228,7 +228,7 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
 
                 if self.settings.vcs_aware:
                     self.has_vcschild = False
-                    self.load_vcs()
+                    self.load_vcs(None)
 
                 for name in filenames:
                     try:
@@ -257,7 +257,7 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
 
                     # Load vcs data
                     if self.settings.vcs_aware:
-                        item.load_vcs()
+                        item.load_vcs(self)
                         if item.vcs_enabled:
                             self.has_vcschild = True
 
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index 8dbf076f..c714cf24 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -193,7 +193,7 @@ class FileSystemObject(FileManagerAware):
                 return None  # it is impossible to get the link destination
         return self.path
 
-    def load_vcs(self):
+    def load_vcs(self, parent):
         """
         Reads data regarding the version control system the object is on.
         Does not load content specific data.
@@ -221,7 +221,7 @@ class FileSystemObject(FileManagerAware):
             rootdir.load_if_outdated()
 
             # Get the Vcs object from rootdir
-            rootdir.load_vcs()
+            rootdir.load_vcs(None)
             self.vcs = rootdir.vcs
             if rootdir.vcs_outdated:
                 self.vcs_outdated = True
@@ -239,7 +239,7 @@ class FileSystemObject(FileManagerAware):
             self.vcs_enabled = backend_state in set(['enabled', 'local'])
             if self.vcs_enabled:
                 try:
-                    if self.vcs_outdated or self.vcs_outdated:
+                    if self.vcs_outdated or (parent and parent.vcs_outdated):
                         self.vcs_outdated = False
                         # this caches the file status for get_file_status():
                         self.vcs.get_status()
@@ -249,9 +249,9 @@ class FileSystemObject(FileManagerAware):
                                 backend_state == 'enabled':
                             self.vcsremotestatus = \
                                     self.vcs.get_remote_status()
-                    else:
-                        self.vcsbranch = self.vcsbranch
-                        self.vcshead = self.vcshead
+                    elif parent:
+                        self.vcsbranch = parent.vcsbranch
+                        self.vcshead = parent.vcshead
                     self.vcsfilestatus = self.vcs.get_file_status(self.path)
                 except VcsError as err:
                     self.vcsbranch = None